Con questo semplice codice voi potete Aprire la finestra e Uscire completamente dal programma .
Private Sub Shutdown()
If NotifyIcon1.Visible Then
NotifyIcon1.Visible = False
End If
Application.Exit()
End Sub
Private Sub Restore()
If Me.WindowState = FormWindowState.Minimized Then
Me.WindowState = FormWindowState.Normal
End If
Me.Visible = True
End Sub
Private Sub mnuApri_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuApri.Click
Me.Restore()
End Sub
Private Sub mnuExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuExit.Click
Me.Shutdown()
End Sub