Close form

  • Thread starter Thread starter john sutor
  • Start date Start date
J

john sutor

When the "X" is selected in the upper right-hand corner of a form, what
event is fired?
 
Hi John,

Closing(CancelEventArgs e)

Where you can set e.Cancel = true to abort closing the form.
 
Hi John,

If you want to make a distinction between closing the form from the X
(system menu|close) and programatically closings, you can override WndProc
method and process WM_SYSCOMMAND with parameter SC_CLOSE
 

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

Similar Threads

Form closing event ? 1
What event is fired 4
How can I stop a windows Media player pop up on my PC 3
Win Form.Close Handler 2
Stop form from closing 6
Form Closing event - again 3
Event on close 8
ComboBox value 4

Back
Top