private void MenuItemExit_Click(object sender, System.EventArgs e) { System.ComponentModel.CancelEventArgs ee = new CancelEventArgs(); this.ClosingHandler(sender, ee); } private void ClosingHandler(object sender, System.ComponentModel.CancelEventArgs e) { if (!this.MyNormalClosingStuff()) e.Cancel = true; else Application.Exit(); }I simply moved the Application.Exit() out of the MenuItem's click event and put it in the normal Closing EventHandler. I assume you already have code in your main form's ClosingHandler that works when you close the main form with the "X". The trick here was simply getting the Application.Exit() into the proper place.