Welcome to WindowsClient.net | Sign in | Join
Handle the form's Closing event.
private void Form1_Closing( object sender, CancelEventArgs e ) { if ( NotOkToClose() ) e.Cancel = true; //don't close }
Contributed from George Shepherd's Windows Forms FAQ