Support Forums

Full Version: [.NET] Minimize to Tray
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Surprised this wasn't posted yet.

Code:
Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
  
      If Me.WindowState = FormWindowState.Minimized Then
  
      Me.Hide()
  
      End If
  
      End Sub
  
      Private Sub NotifyIcon1_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseClick
  
      If Me.WindowState = FormWindowState.Minimized Then
  
      Me.Show()
  
      Me.WindowState = FormWindowState.Normal
  
      End If
  
      End Sub
(04-05-2010, 05:44 PM)Yin Wrote: [ -> ]Surprised this wasn't posted yet.

Code:
Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
  
      If Me.WindowState = FormWindowState.Minimized Then
  
      Me.Hide()
  
      End If
  
      End Sub
  
      Private Sub NotifyIcon1_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseClick
  
      If Me.WindowState = FormWindowState.Minimized Then
  
      Me.Show()
  
      Me.WindowState = FormWindowState.Normal
  
      End If
  
      End Sub

Easy,but nice..

ThanksBlackhat
Thanks for the code! I will add this to my project. Smile