Disable the Win Form’s Close Button using C#Here is the simple way to disable the Form’s close button. Just copy the following code in your code behind. Then run the form, surely the close button would be disabled.
private const int CP_NOCLOSE_BUTTON = 0x200;
protected override CreateParams CreateParams
CreateParams myCp = base.CreateParams;
myCp.ClassStyle = myCp.ClassStyle | CP_NOCLOSE_BUTTON;