Hi Martin,
Every Type derived from System.Componen tModel.Componen t (which includes all
Controls and the Form class itself) has a Site property. Visual Studio sets
the Site when the Component is being hosted by a designer. In that case the
Site.DesignMode property will be true. At runtime, check if Site is null or
Site.DesignMode is false:
if (Site == null || !Site.DesignMod e)
{
// not in design mode
}
You can't perform this check in the constructor, however, because VS hasn't
set the Site property yet. (The Site property can't be set by VS until after
the Component is constructed, obviously)
--
Dave Sexton
"Martin Arvidsson" <ye*******@ms.c omwrote in message
news:uU******** ******@TK2MSFTN GP03.phx.gbl...
Hi!
I have developed a component that creates a lookup for selecting values.
At designtime i want to display the windows as well but with certain
criterias.
is there a property or something to look at that tells mee if its designtime
or runtime?
Regards
Martin