Re: How to prevent code from being executed by the Designer?

Tech-Archive recommends: Speed Up your PC by fixing your registry



Thanks to all of you guys.

In reality I need this in an object inherited from UserControl, not from
Form.

The constructor of my UserControl will create some unmanaged objects using
interops, and I suspect this is what is causing lots of problems with my VS.
See my other post just two hours ago: "Bad UserControl in toolbox".

Regards,
Fabio


"D. Yates" <foeman@xxxxxxxxxxx> wrote in message
news:eHr1xv%23CGHA.2644@xxxxxxxxxxxxxxxxxxxxxxx
> Fabio,
>
> When developing user controls or custom controls, I SOMETIMES use
> this.DesignMode to prevent things from being created.
>
> Why do you need it for a form?
>
> Dave
>
> "Fabio Cannizzo" <fcannizzo.mifft2001@xxxxxxxxxx> wrote in message
> news:43b2f12d$0$1071$4fafbaef@xxxxxxxxxxxxxxxxxxxxxx
>> How can I prevent a few lines of code contained in the constructor of a
>> Form from being executed by the Designer?
>>
>> Thanks,
>> Fabio
>>
>
>


.


Quantcast