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