Load Event firing in User Controls

  • Thread starter Thread starter Glenn
  • Start date Start date
G

Glenn

I am seeing this behavior and do not know if it is normal:

When I hav a user control nested in another user control, the load event of
the nested control is firing 3 times. The unnested control is firing twice.
Both controls fire the load event twice when not nested.

Even stranger, both controls are firing the load event when the form is
closing!

Thanks for any help.

Glenn
 
The load event of a usercontrol is tied to the OnCreateControl so it's
possible that something is causing the handle to get recreated after it's
been destroyed. Try putting a break point in the load event and see what is
in the call stack when its called as the form is closing.
 
Andrew:

Thanks. It looks like a container Active X control is the reason the Net
control is firing these events multiple times. When used outside of this
control, the events only fire once.

Best,
Glenn
 
Back
Top