how can i capture the exit/close event when someone clicks the "x" button

  • Thread starter Thread starter Mullin Yu
  • Start date Start date
as subject
If your form is "myForm", go to the InitializeComponents method, and
in the "myForm" section, type this.Closing+= (tab-tab)

The (tab-tab) will create the nessecary method,
private void myForm_Closing(object sender, CancelEventArgs e)
{
//set e.Cancel =true to prevent exiting

}
 
But, I want to have a FORM-LESS application because I don't want to have the
command prompt so that I didn't choose command application.

If no form, how can I capture the application exit event??

Thanks!

Mullin
 
Back
Top