Home All Groups Group Topic Archive Search About
Author
22 Nov 2004 6:55 PM
Serg
What is the correct way to detect Design Mode when building controls in
WinForms?
Thank you

Author
22 Nov 2004 6:59 PM
Herfried K. Wagner [MVP]
"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/>
Author
22 Nov 2004 7:29 PM
Serg
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/>
>
Author
23 Nov 2004 8:33 AM
Claes Bergefall
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/>
> >
Author
23 Nov 2004 6:23 PM
Serg
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/>
> > >
>
>
>

AddThis Social Bookmark Button