Click here to Skip to main content
Click here to Skip to main content

Disabling Close Button (X in top right corner of ControlBox)

By , 4 Apr 2011
 
private const int disableX = 0x200;
        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams ObjClose = base.CreateParams;
                ObjClose.ClassStyle = ObjClose.ClassStyle | disableX;
                return ObjClose;
            }
        }

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

charles henington
United States United States
Member
I do not claim to be wrong! I just rarely ever write.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralRe: I think that using API functions to do this job is better th...memberYouzelin5 Jul '11 - 21:36 
I think that using API functions to do this job is better than overriding CreateParams. Because sometime we will add other functions which also need overriding CreateParams. In fact, I met such problem 2 years before, but now I cannot remember that.
GeneralReason for my vote of 3 I think using API to do this job is ...memberYouzelin4 Jul '11 - 20:56 
Reason for my vote of 3
I think using API to do this job is better than this, taking another operations related to WndParams into account.
GeneralRe: Well if you think so where is the Alternative???? membercharles henington5 Jul '11 - 14:08 
Well if you think so where is the Alternative????

GeneralReason for my vote of 5 small good tipmemberboh-unipac13 Apr '11 - 6:44 
Reason for my vote of 5
small good tip
GeneralRe: Thanks hope it helps membercharles henington18 Apr '11 - 5:08 
Thanks hope it helps

GeneralReason for my vote of 5 nice sharememberRidho Anggoro4 Apr '11 - 23:11 
Reason for my vote of 5
nice share
GeneralRe: thanksmembercharles henington6 Apr '11 - 4:42 
thanks

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web01 | 2.6.130523.1 | Last Updated 4 Apr 2011
Article Copyright 2011 by charles henington
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid