Search code examples
c#formsformclosing

How to detect when a form is closing from another form still open?


I am just wondering how can I detect when a form is closing from ANOTHER FORM, Say I have my main client open another form open called sender, how would I detect when the sender form is closing from the main client form?


Solution

  • Attach an event handler to the form's closing event.

    This will allow you to do whatever it is you want to do when the form closes.