Getting form to minimize when exit button is clicked

lickuid

Active member
Joined
Nov 6, 2006
Messages
37
Programming Experience
Beginner
Does anyone know how to override a form closing? In other words, when I click the red exit button, I want the form to hide() instead of actually closing... Any help will be greatly appreciated.
 
in the form's Closing event set e.Cancel to True then right after that Me.Hide()

VB.NET:
Private Sub Form_Closing (...) Handles MyBase.Closing
  e.Cancel = True
  Me.Hide()
End Sub
 
Back
Top