//
you're reading...
IT-Center, VB.NET

System Tray on Minimaze Click using VB.NET

Add a NotifyIcon to your form by double-clicking on it in the Toolbox

Private Sub Form1_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Resize
     ' If minimize form that will show in system tray.
     If System.Windows.Forms.FormWindowState.Minimized = WindowState Then
     sysMonTray.ShowBalloonTip(5, "Running", "Running Your Program", ToolTipIcon.Info)
     Me.Hide()
   End If
End Sub
Private Sub sysMonTray_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles sysMonTray.Click

If Me.Visible Then
    Me.Hide()
Else
    Me.Show()
    Me.ShowInTaskbar = True
    Me.WindowState = FormWindowState.Normal
    Me.StartPosition = FormStartPosition.CenterScreen
End If

End Sub

About berbagisolusi

Berbagi merupakan sebuah bentuk simbol keikhlasan untuk membantu dan menolong, sedangkan solusi adalah cara menyelesaikan masalah. Setiap manusia pasti mengalami masalah, tetapi kita tidak perlu mengalami masalah yang sama jika orang lain pernah mengalami dan kita tahu hal tersebut.

Discussion

No comments yet.

Leave a comment

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 10 other subscribers
December 2011
M T W T F S S
 1234
567891011
12131415161718
19202122232425
262728293031  

Archives

Web Statistic

Blog Stats

  • 187,137 hits