|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Detecting DesignMode?What is the correct way to detect Design Mode when building controls in
WinForms? Thank you "Serg" <S***@discussions.microsoft.com> schrieb: \\\> What is the correct way to detect Design Mode when building controls in > WinForms? If Me.DesignMode Then ... End If /// -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> DesignMode is always false if ISite is not implememnted (which is stated in
Documentation). In my case DesignMode is always false. Any other suggestions? Show quote "Herfried K. Wagner [MVP]" wrote: > "Serg" <S***@discussions.microsoft.com> schrieb: > > What is the correct way to detect Design Mode when building controls in > > WinForms? > > \\\ > If Me.DesignMode Then > ... > End If > /// > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://dotnet.mvps.org/dotnet/faqs/> > Actually it says that DesignMode is false if the component
doesn't have an ISite associated with it. You can't use it in the constructor if that's what you're doing (since the ISite hasn't been associated yet). Move your code to another place. /claes Show quote "Serg" <S***@discussions.microsoft.com> wrote in message news:1668F91F-1594-48C1-945E-20F445756C0B@microsoft.com... > DesignMode is always false if ISite is not implememnted (which is stated in > Documentation). In my case DesignMode is always false. Any other suggestions? > > > > "Herfried K. Wagner [MVP]" wrote: > > > "Serg" <S***@discussions.microsoft.com> schrieb: > > > What is the correct way to detect Design Mode when building controls in > > > WinForms? > > > > \\\ > > If Me.DesignMode Then > > ... > > End If > > /// > > > > -- > > M S Herfried K. Wagner > > M V P <URL:http://dotnet.mvps.org/> > > V B <URL:http://dotnet.mvps.org/dotnet/faqs/> > > Ok, thanks all!
Show quote "Claes Bergefall" wrote: > Actually it says that DesignMode is false if the component > doesn't have an ISite associated with it. > > You can't use it in the constructor if that's what you're doing > (since the ISite hasn't been associated yet). Move your > code to another place. > > /claes > > "Serg" <S***@discussions.microsoft.com> wrote in message > news:1668F91F-1594-48C1-945E-20F445756C0B@microsoft.com... > > DesignMode is always false if ISite is not implememnted (which is stated > in > > Documentation). In my case DesignMode is always false. Any other > suggestions? > > > > > > > > "Herfried K. Wagner [MVP]" wrote: > > > > > "Serg" <S***@discussions.microsoft.com> schrieb: > > > > What is the correct way to detect Design Mode when building controls > in > > > > WinForms? > > > > > > \\\ > > > If Me.DesignMode Then > > > ... > > > End If > > > /// > > > > > > -- > > > M S Herfried K. Wagner > > > M V P <URL:http://dotnet.mvps.org/> > > > V B <URL:http://dotnet.mvps.org/dotnet/faqs/> > > > > > > |
|||||||||||||||||||||||