In my application I need a way to distiguish between the following events:
1. When a user closes an MDI child window.
2. When the user closes the MDI parent window which subsequently closes
the MDI child window.
My application does certain logic when the user actually closes the MDI
child form by clicking the "X" in the upper right hand. My application,
however, should not execute this logic if the user closes the MDI parent. I
tried handling the Form.Closing event on the child window. The problem is,
that in both of the cases above, the sender is the MDI child
window--therefore the event handler doesn't know who actually closed the
form. More bad news for me: the MDI child Form.Closing event occurs before
the Parent Form.Closing event (so I can't set a flag or something on the
parent closing event to let the child closing events know that they should
not execute the application logic.)
What trick do I need to know about?
Thanks!