I was wondering, how can i catch the event when someone clicks on the little X in the right corner of an application? I need to do some processing and checking right before the application closes i just dont see what to catch to be able to do that.
Printable View
I was wondering, how can i catch the event when someone clicks on the little X in the right corner of an application? I need to do some processing and checking right before the application closes i just dont see what to catch to be able to do that.
Use the Closing event of the form
Code:private void YourForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
//to cancel closing of the form
//e.Cancel = true;
}
I must have not had the form active when i clicked the little lightning bolt in VS.NET, thanks again Serge!