ShowDialog always raises the Load event

adriaan

Member
Joined
Feb 28, 2005
Messages
13
Programming Experience
5-10
Hi,

Why does ShowDialog always raise the Load event of a form, it does not matter if you hide.

I am hiding my form when the user clicks on OK button. I am doing validation outside the form, if validation fails I ShowDialog the form again, but it always fire the Load event and I have databinding coding in my Load event that throws exeception because it binds to the same property.

Any suggestions.

Thanks
 
put it in the New sub constructor for the form (right after the call to InitializeComponents).

It only fires onces, when the instance of the form is created.

Tg
 
Back
Top