I want to disable Only the close button of my windows form
this.ControlBox = false;
disables all the function even the minimize and maximize button
is there other way to solve this. It is OK if it is visible but cannot be clicked.
I want to disable Only the close button of my windows form
this.ControlBox = false;
disables all the function even the minimize and maximize button
is there other way to solve this. It is OK if it is visible but cannot be clicked.
You cannot disable only the "X" button from controlbox. You can change the FormBorderStyle and build your own custom buttons.
If you want it to be visible but change the close behavior, you can listen Form_Closing event and check the CloseReason property of FormClosingEventArgs object.