Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I remove the Close button from a forms title bar?

bar button form remove title
0
Posted

How do I remove the Close button from a forms title bar?

0

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.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.