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

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

, 4 Apr 2011
Rate this:
Please Sign up or sign in to vote.
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
I do not claim to be wrong! I just rarely ever write.

Comments and Discussions

 
GeneralRe: I think that using API functions to do this job is better th... PinmemberYouzelin5-Jul-11 21:36 
GeneralReason for my vote of 3 I think using API to do this job is ... PinmemberYouzelin4-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???? Pinmembercharles henington5-Jul-11 14:08 
GeneralReason for my vote of 5 small good tip Pinmemberboh-unipac13-Apr-11 6:44 
GeneralRe: Thanks hope it helps Pinmembercharles henington18-Apr-11 5:08 
GeneralReason for my vote of 5 nice share PinmemberRidho Anggoro4-Apr-11 23:11 
GeneralRe: thanks Pinmembercharles henington6-Apr-11 4:42 

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

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