2 Replies - 1481 Views - Last Post: 14 March 2012 - 05:37 AM

#1 xYASSiiNEx  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 22-February 12

Disable the default close button

Posted 25 February 2012 - 05:26 AM

Description: Put this code under public partial classThis code will grey out the close button and disable it.
    public partial class Form1 : Form1
    {
        // Greys out the close button
        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;
            }
        }


Is This A Good Question/Topic? 0
  • +

Replies To: Disable the default close button

#2 nK0de  Icon User is offline

  • Catch me As Exception
  • member icon

Reputation: 206
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: Disable the default close button

Posted 14 March 2012 - 02:49 AM

Cool stuff. Might be useful. Thanks
Was This Post Helpful? 0
  • +
  • -

#3 xYASSiiNEx  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 22-February 12

Re: Disable the default close button

Posted 14 March 2012 - 05:37 AM

No problem ;)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1