vb.net系统托盘菜单怎样显示在系统托盘图标的上方

PublicClassForm1PrivateSubButton1_Click_1(ByValsenderAsSystem.Object,ByValeAsSystem.E... Public Class Form1
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Hide()
ShowInTaskbar = False
NotifyIcon1.Icon = Me.Icon
NotifyIcon1.Visible = True
End Sub

Private Sub 显示窗体ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 显示窗体ToolStripMenuItem.Click

'恢复显示窗体
Me.Show()
End Sub

Private Sub 退出ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 退出ToolStripMenuItem.Click
'关闭窗体,退出程序

Me.Close()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Me.Close()
End Sub

Private Sub NotifyIcon1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseClick
ContextMenuStrip1.Visible = True
End Sub
End Class
展开
 我来答
beeisred
2012-06-22 · TA获得超过1371个赞
知道小有建树答主
回答量:837
采纳率:0%
帮助的人:610万
展开全部
NotifyIcon1属性中ContextMenustrip=ContextMenuStrip1
在NotifyIcon1的属性中修改就可以了,好像可以去掉以下内容,用鼠标右键点击图标就可以了
Private Sub NotifyIcon1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseClick
ContextMenuStrip1.Visible = True
End Sub
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式