Closing a MDI child form

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

Guest

I'm working on a MDI application, and I would like to notify the app's main
form when a child form has been closed. What's the best way to do this?

I was thinking about sending a message to the main form via the
System.Windows.Forms.Message class, but I thought I'd see if there's a better
approach first.

Thanks for your help.

Chris
 
I would override the child form's Closed event with a delegate to a local
event handler.

Example:

ChildForm mychild = new ChildForm
mychild.Closed += new System.EventHandler(ChildClosed);

So when the child form closes, it will fire off your local event handler via
the delegate and you can do whatever with it.

Cheers
Shane Sukul
BSC MCSD MCAD
 
Back
Top