how to stop code in usercontrol running at design time?

T

Tee

Hi,

I have a usercontrol that has the onload event.
When I drag the usercontrol to form (add it to a form), the code get
executed and throw exception.

The code run fine on runtime, any idea how can I stop the code running at
the VS IDE desgin time?

Thanks,
Tee
 
T

Tom Clement

I use the DesignMode protected properties (inherited from Component) that is
available when you've derived from a UserControl.
Tom Clement
Apptero, Inc.
 
T

Tee

Thanks. I got it.


Tom Clement said:
I use the DesignMode protected properties (inherited from Component) that is
available when you've derived from a UserControl.
Tom Clement
Apptero, Inc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top