UserControl Auto Execute in DesignMode

T

Tiago Barbutti

I have a UserControl that execute methods in Load event,
but it hapens in designMode and generate an error and the
control disappear from the form.
I read that i can use the DesignMode to kwnow when my
control is in design or Runtime mode, it´s work, but when
this usercontrol is put in another usercontrol the
DesignMode property always return false.
How can I do to stop the methods to execute in
designMode when my usercontrol is in another usercontrol ?

Thanks, Tiago.
 
N

Nick Harris

Use the DesignMode boolean in the deepest layer of your controls, and any
subsequent controls. Whether it's in design mode is relative to the nest
level of user controls.

Nick Harris, MCP, CNA, MCSD
Director of Software Services
http://www.VizSoft.net


I have a UserControl that execute methods in Load event,
but it hapens in designMode and generate an error and the
control disappear from the form.
I read that i can use the DesignMode to kwnow when my
control is in design or Runtime mode, it´s work, but when
this usercontrol is put in another usercontrol the
DesignMode property always return false.
How can I do to stop the methods to execute in
designMode when my usercontrol is in another usercontrol ?

Thanks, Tiago.
 

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