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
 
Back
Top