User Control Unload event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there some event that triggers inside a user control when its parent form
is closed? I have a user control that subscribes to an event in its
constructor. I need it to unsubscribe when it is no longer needed, but I
can't find an appropriate event to hook into. Is there a standard method for
handling this kind of situation?

Thanks,
Steve
 
Hi Steve,

Try using the Dispose Event of the user control and you should be able to
know when it is terminated.
{if it is time critical, read the concepts of Garbage collector, which
actually disposes the objects at its own pace}

UserControl1_Disposed

I hope this helps!
-Rajneesh
 

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

Back
Top