Groups | Blog | Home
all groups > dotnet windows forms > september 2004 >

dotnet windows forms : Don't need to do load event from inheritance form


KPH
9/29/2004 8:25:03 PM
Hi all,

Assuming I have 2 form controls on my application. First form is parent form
and second form is inheritance form that inherit from first form.

When I want to view designer of second form (inheritance form) it is always
done at load event of first form (parent form). I have test by set form
visible property at load event of first form to false and then when I load
the second form the form is invisible. Can anyone explains to me?

I don't need to do load event of first form because sometimes I want to add
new control to second form but it occurs some error. How can I ignore the
load event of parent form?


Thanks,
KPH


KPH
9/29/2004 11:53:01 PM
Hi,

I try by your example but it's not work because I don't know the
OnInitialize() and Load() function come from. Would you please tell me more
information or details that help me solve this problem.

Thanks,
KPH

[quoted text, click to view]
johndoe NO[at]SPAM driver.net
9/30/2004 12:48:51 AM
Form1 { public OnOnitialize() { this.OnLoad += new Load(); other control
creation code goes here }

Form2:Form1 { public OnInitiailze() { this.OnLoad += new Load(); other
control creation code goes here. base.OnInitialize(); }

if Form2 calls a base method of its inherited member then it may bind both
events. .


[quoted text, click to view]

AddThis Social Bookmark Button