VB.NET中的NotifyIcon怎么用
1个回答
展开全部
'点击状态栏的图标时显示窗体
Private Sub notifyIcon1_MouseClick(ByVal sender As Object, ByVal e As MouseEventArgs)
If Me.WindowState = FormWindowState.Minimized Then
Me.WindowState = FormWindowState.Normal '还原
End If
Me.Activate()
Me.notifyIcon1.Visible = False
Me.ShowInTaskbar = True
End Sub
'程序关闭时清除状态栏图标
Private Sub 退出ToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs)'关闭应用程序
Me.notifyIcon1.Visible=False
Me.Close()
Application.Exit()
End Sub
Private Sub notifyIcon1_MouseClick(ByVal sender As Object, ByVal e As MouseEventArgs)
If Me.WindowState = FormWindowState.Minimized Then
Me.WindowState = FormWindowState.Normal '还原
End If
Me.Activate()
Me.notifyIcon1.Visible = False
Me.ShowInTaskbar = True
End Sub
'程序关闭时清除状态栏图标
Private Sub 退出ToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs)'关闭应用程序
Me.notifyIcon1.Visible=False
Me.Close()
Application.Exit()
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询