Question
Enable/disable windows form X button
Could you please how to disable/enable windows from x button. I tried to set property this ControlBox=false but this hides all of those sizing buttons. Not just the X. Then i tried to use this below code through C# code but i got the error that can't be override method CreateParams.
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;
}
}
Please anyone help me to resolve the issue.
Thanks