Add this code to your form.
Code:
Private Sub Form1Closing(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
e.Cancel = True
End Sub
If you want to be able to exit, add this code to a button
It should look something like this, IF your button is called Button1 and your form is called Form1
Code:
Public Class Form1
Private Sub Form1Closing(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
e.Cancel = True
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End
End Sub
End Class