We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,725 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

Code to Disable close button on the form

2
By Abel Lazm on Apr 4th, 2011 10:17 am

Add this code any where in your main form and You will be able to disable the X button on a winForm

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

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0500 seconds using 2.62MB