The Form
has two properties called MinimizeBox
and MaximizeBox
, set both of them to false
.
Close button
During construction and creation of the Form object, .NET would use the default creation parameters available in the base class CreateParams property.
In fact, CreateParams property
is available in Forms.Control class. In form class (derived from System.Windows.Forms.Form), override this property and modify the creation flags. For disabling the Close button use 0x200
to modify the ClassStyle member of the 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;
}
}
pls go through this link for more info