需要做什么才能使您的.NET应用程序显示在Window的系统托盘中作为图标?
而且您如何处理所述图标上的鼠标点击次数?
首先,在窗体中添加一个NotifyIcon控件。然后连接通知图标来做你想要的。
如果您希望将其最小化隐藏到托盘,请尝试这样做。
Private Sub frmMain_Resize(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles MyBase.Resize If Me.WindowState = FormWindowState.Minimized Then Me.ShowInTaskbar = False Else Me.ShowInTaskbar = True End If End Sub Private Sub NotifyIcon1_MouseClick(ByVal sender As Object,ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseClick Me.WindowState = FormWindowState.Normal End Sub
我偶尔会使用气球文本来通知用户 – 这样做是这样做的
Me.NotifyIcon1.ShowBalloonTip(3000,"This is a notification title!!","This is notification text.",ToolTipIcon.Info)