The System.Windows.Forms.Control (and all inherited classes, therefore)
class has a property called "DesignMode" which is a boolean value. If you
don't want to run code in the designer, use a test for DesignMode to prevent
it from running.
--
HTH,
Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP
"stuppi" <(E-Mail Removed)> wrote in message
news:C8677178-99F1-4130-B486-(E-Mail Removed)...
>I often create classes that inherit from standard controls in order to
>handle
> certain events in a consistent manner. Being a novice propononet of
> encapsulation, I add the event handlers in the constructor of the derived
> class. However, as many of you have probably discovered, this can create
> problems with WinForms and the VS forms designer if those event handlers
> rely
> on runtime conditions. Can anyone suggest a "designer safe" place to add
> the
> event handlers within the derived class?
>
|