Capture Close Button Event

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hello all:

Is it possible to capture the close event of the 'X' button?

Thanks,

John
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top