Capture Close Button Event

  • Thread starter Thread starter John
  • Start date Start date
You can use the Closed, or Closing, event of the Form. If you're using the
..NET 2.0 framework then it's recommended that you use the FormClosed, or
FormClosing, event.
 
John said:
Is it possible to capture the close event of the 'X' button?

You can intercept closing a form by adding a handler to its 'Closing' event.
 
Herfried said:
You can intercept closing a form by adding a handler to its 'Closing'
event.
Sometimes is the simplest things that drive you nuts. I had used the
Closing event for some other code that would have prevented its use to
exit the application. However, I neglected the Closed event and it
seems to work just fine. Thank you so much for your direction.

John
 
Back
Top