>>With the Closing() event.
>
>You mean the Closed() event.
You can use either. If you want to avoid form closing, Closed() is too late.
Here is an example that conditionally avoids closing:
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
e.Cancel = (MessageBox.Show("Some question", "Message",
MessageBoxButtons.OKCancel, MessageBoxIcon.Information )).ToString()
!= "OK";
}
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)