UserControl Auto Execute in DesignMode

  • Thread starter Thread starter Tiago Barbutti
  • Start date Start date
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.
 
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.
 
Back
Top