form.load and form constructor

  • Thread starter Thread starter Cyrus
  • Start date Start date
C

Cyrus

which one is better to place the UI initialization code?
it seems that load event is not very useful...
anything is good to put there?
 
Hi Cyrus,

You should override OnLoad virtual method and put your code between
if (!DesignMode)
{
}
block.
 
* "Cyrus said:
which one is better to place the UI initialization code?
it seems that load event is not very useful...

Why is it "not very useful"?
 
in what situation should this load event show its usefulness
any example?
because i found that many things can be done in the constructor
thz a lot.
 
What about checking the DesignMode property?
It will be always false in constructor...

--
Miha Markic - DXSquad/RightHand .NET consulting & software development
miha at rthand com


Cyrus said:
in what situation should this load event show its usefulness
any example?
because i found that many things can be done in the constructor
thz a lot.
 
i dont understand
if a form is just construct, why should we check its property?
we must know it value is false, am i correct?
 
* "cyrus said:
i dont understand
if a form is just construct, why should we check its property?
we must know it value is false, am i correct?

Are you referring to the value of the 'DesignMode' property?
 
Back
Top