Visual Basic - Remove Close Button
In this tutorial I'll teach you how you can disable/remove the close button on your windows form applications !
Start by opening or creating a windows form application.
Go to your design of form1 and click the events button at the formproperties.
Look for the event called "formclosing"
Double click the event and enter the following code:
If e.CloseReason = CloseReason.UserClosing Then
e.Cancel = True
This code basically means that the User can no longer close the form, but he can still close it using the taskmanager.
If you now run your project and click the close button, it won't close!
You can also remove the close button by setting Controlbox to false in form1 properties: