Private Sub form_BestellingenEditor_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
e.Cancel = True
End Sub
Preventing a form form closing
When a form is being closed, either through alt-f4 or the controlbox, the formclosing event is fired. At this point, you can take additional action, or prevent the form from closing alltogether.