Load Event firing in User Controls

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
 
A

Andrew Smith \(Infragistics\)

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.
 
G

Glenn

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top