32.25 How do I prevent a Form from closing when the user clicks on the close button on the form's system menu?


Handle the form's Closing event.

private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
     if( NotOkToClose() )
          e.Cancel = true; //don't close
}

© 2001-2010 Copyright Syncfusion Inc. All rights reserved.  |  Privacy Policy  |  Contact  |  Sitemap