How do I remove the Close button from a forms title bar?
Set the property Form.ControlBox to false. Contributed from George Shepherd’s Windows Forms FAQ, # No product version has been specified for this FAQ item. Please report status updates here. • How do I display a confirmation dialog when the user closes the form? You can listen to the Form’s Closing event, where you can display a MessageBox as show below: using System.ComponentModel; private void Form1_Closing( object sender, CancelEventArgs e ) { string text = “Do you want to close the application?”; string caption = “Close Application”; if ( MessageBox.Show( text, caption, MessageBoxButtons.YesNo ) == DialogResult.No ) e.Cancel = true; } Contributed from George Shepherd’s Windows Forms FAQ, # No product version has been specified for this FAQ item. Please report status updates here.