I have a problem, with a closed form event.
I'd like to make a check with a click on close botton in the title bar that check if the user are sure or not to close the application.
I have made a method that ask if the user are sure when click on the X in the title bar but when the user select the no option what must I do to evitate that the application was closed??

Thanks a lot for the help.

could you ask that again in english?

could you ask that again in english?

Sorry for my english.
I have made a windows form application.
My application is a Mdicontainer with many child form.
I want to check che closed event of this form, and when happend i want to intercept it and ask a confermation of closing application.
This part I don't have problem to implement.
My problem is the messagebox that ask if the user want really to close (Yes/No).
I have made a method that check if the Dialog result is Yes or no, but when the result it's no, want i can do to stopping the closing operation of the application??

Thanks a lot.

private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
		{
				if(MessageBox.Show("Are you sure you want to close?", "Closing Program", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
					e.Cancel = true;
			
		}

Thanks a lot for your help.

I have prove it and this work perfectly.