Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[.NET] Minimize to Tray
#1
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
Reply
#2
(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
[Image: 20r9vh4.jpg]
Reply
#3
Thanks for the code! I will add this to my project. Smile
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Mini Tut] How to Minimize to Icon on Task Bar [mini Tut] ( Great For MSN Freezers ET Trihunter3 3 1,253 04-18-2011, 07:12 AM
Last Post: Mammoth
  Hide Icon In System Tray Scorpion 4 1,241 04-18-2010, 04:33 AM
Last Post: [ Process.xSs ]

Forum Jump:


Users browsing this thread: 1 Guest(s)