The form seen in the designer is not actually an instance of the Form1 class
you're designing but a simple form with the relavent controls added to it.
Custom controls however are instances of the real thing so you could create
a custom control that covered the form entirely and do design-time detection
on that. You may also be able to do design time detection on a derived form
that uses visual inheritance. In any case, the DesignMode property is never
valid in the constructor.

Signature
Bob Powell [MVP]
Visual C#, System.Drawing
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
> Hi,
>
[quoted text clipped - 7 lines]
> Egil Winther
> ShipNet AS
Egil Winther - 31 May 2005 12:21 GMT
Thanks Bob,
I just moved my code from the constructor to the Load-event, and everything
was fine.
Rgds
Egil Winther
ShipNet AS
> The form seen in the designer is not actually an instance of the Form1 class
> you're designing but a simple form with the relavent controls added to it.
[quoted text clipped - 15 lines]
> > Egil Winther
> > ShipNet AS