Wednesday, June 17, 2009

How to disable the Close button of win forms?

Many times, there was a requirement to hide or disable the close button at the top right of the form.
There is a way to hide the control box by setting the ControlBox property to false. But unfortunately it removes the Windows icon which could be key to the company's/personal branding/marketing efforts.
The below code disables the close button without hiding the window's icon.

No comments:

Post a Comment