加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

[VB.NET]如何将图标放在系统托盘上

发布时间:2020-12-16 23:43:18 所属栏目:大数据 来源:网络整理
导读:如何将图标放在系统托盘上 如何将图标放在系统托盘上? 及单击最小化到系统托盘上,再单击系统托盘上的图标弹出窗体界面,请大虾指教,谢谢 __________________________________________________________________________ 看这里吧,写得很清楚。 http://hi.
如何将图标放在系统托盘上 如何将图标放在系统托盘上? 及单击最小化到系统托盘上,再单击系统托盘上的图标弹出窗体界面,请大虾指教,谢谢 __________________________________________________________________________ 看这里吧,写得很清楚。 http://hi.baidu.com/winlt/blog/item/99056d277a390a03908f9d64.html __________________________________________________________________________ 加入一个NotifyIcon控件,然后 Dim boolClose As Boolean = False Private Sub Form1_FormClosed(ByVal sender As Object,ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed NotifyIcon1.Visible = False End Sub '' 点击关闭时最小化到System Tray,而不关闭 Private Sub Form1_FormClosing(ByVal sender As Object,ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing If boolClose = False Then e.Cancel = True Me.Visible = False NotifyIcon1.Visible = True End If End Sub '' 点击System Tray图标时显示主窗体 Private Sub NotifyIcon1_MouseClick(ByVal sender As Object,ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseClick If e.Button = Windows.Forms.MouseButtons.Left Then Me.Visible = True NotifyIcon1.Visible = False End If End Sub __________________________________________________________________________ 这样会退不出程序,要在菜单中和NotifyIcon的右键菜单中加入令boolClose为真然后关闭窗口的的项,使程序可以退出。 __________________________________________________________________________ 好的,谢谢各位,成功了 __________________________________________________________________________

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读