c# windows forms cancel event code example
Example: c# windows forms cancel event
private void form1_FormClosing(object sender, FormClosingEventArgs e)
{
MessageBox.Show("Form Closing...");
e.Cancel = true;
MessageBox.Show("Form Closing Canceled.");
}