Disable Close button in C# Window Forms

private const int CP_NOCLOSE_BUTTON = 0x200;
 protected override CreateParams CreateParams
 {
     get
     {
        CreateParams myCp = base.CreateParams;
        myCp.ClassStyle = myCp.ClassStyle | CP_NOCLOSE_BUTTON ;
        return myCp;
     }
 }

3 thoughts on “Disable Close button in C# Window Forms

  1. Hello my family member! I wish to say that this post is amazing, great
    written and come with approximately all vital infos.
    I’d like to peer extra posts like this .

  2. An outstanding share! I have just forwarded this onto
    a friend who was conducting a little homework on this. And he actually ordered me breakfast simply because I stumbled upon it
    for him… lol. So let me reword this…. Thank YOU for the meal!!
    But yeah, thanx for spending some time to discuss this
    topic here on your site.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s