Remove The Close Button In VB2008/2010
Posted by saad alti
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
End If
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.
This entry was posted on October 4, 2009 at 12:14 pm, and is filed under
Visual Studio
. Follow any responses to this post through RSS. You can leave a response, or trackback from your own site.