Tuesday, April 19, 2011

Paralyzing Close Button X form Control Box in .Net Desktop App

Just add the following code in your App or in the form which you want to make disabling.
 
C# 
 
private const int disableX = 0x200;
        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams ObjClose = base.CreateParams;
                ObjClose.ClassStyle = ObjClose.ClassStyle | disableX;
                return ObjClose;
            }
        }

No comments:

Post a Comment