Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
e.Cancel = True
End Sub
Using the Cancel = true, stops the program from ending, after that you want to add any code for the systemtray icon. I believe you'll want to look at NotifyIcon class.
Just a note, remember that adding e.Cancel = true, although prevents the application from being closed, remember you to take into account when you application is running and a user shuts down their computer, because this will halt the shutdown process.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.