In the closing event of the form, do something like this:
Private Sub Form1_Closing(ByVal sender As Object, _
ByVal e As System.ComponentModel.CancelEventArgs) _
Handles MyBase.Closing
Me.Hide()
e.Cancel = True
End Sub
Note that you'll then need to use Application.Exit( ) to exit the
application since closing the form is not going to exit and also calling
Form1.Close won't help since this also fires the Closing event.
hope that helps..
Imran.
"Matthew" <tu*************@alltel.net> wrote in message
news:OW**************@TK2MSFTNGP10.phx.gbl...
I would like to make it so when a user clicks the X in the upper right
corner it hides the form instead of closing it. I have an icon in the
system tray, and other forms running. If the main form closes, these exit
as well.
Can this be done?
Matthew