How to attach to ParentForm.Closed?

  • Thread starter Thread starter Boris Drajer
  • Start date Start date
B

Boris Drajer

When is a good moment to attach to ParentForm.Closed event? I want to be
notified when the form is closing, because I want to kill a worker
thread in my control. But, I don't know when the ParentForm property has
a valid value: if I put my control in a tab, ParentForm is null in OnLoad.
 
Register for your control/form's ParentChanged event, then do it there. That
ought to be the first chance you have to know who your parent is.

-Nathan
 
Back
Top