Minimize to System Tray


SUBMITTED BY: Guest

DATE: Dec. 7, 2013, 8:16 a.m.

FORMAT: Text only

SIZE: 1.0 kB

HITS: 751

  1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2. NotifyIcon1.Visible = False
  3. End Sub
  4. Private Sub NotifyIcon1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick
  5. Try
  6. Me.Show()
  7. Me.WindowState = FormWindowState.Normal
  8. NotifyIcon1.Visible = False
  9. Catch ex As Exception
  10. MsgBox(ex.Message)
  11. End Try
  12. End Sub
  13. Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
  14. Try
  15. If Me.WindowState = FormWindowState.Minimized Then
  16. Me.WindowState = FormWindowState.Minimized
  17. NotifyIcon1.Visible = True
  18. Me.Hide()
  19. End If
  20. Catch ex As Exception
  21. MsgBox(ex.Message)
  22. End Try
  23. End Sub

comments powered by Disqus