六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網(wǎng)中心:是一個免費(fèi)提供流行視頻軟件教程、在線學(xué)習(xí)分享的學(xué)習(xí)平臺!

對于任務(wù)欄式的托盤圖標(biāo)及其右鍵菜單的完成!

[摘要]實(shí)現(xiàn)方法:(用VS.net的可視化實(shí)現(xiàn))新建一個項(xiàng)目(notifyicon)把右鍵菜單(contextmenu)拖入表單中.加入菜單的子菜單項(xiàng)。比如“顯示”、“隱藏”等菜單項(xiàng)。雙擊各菜單項(xiàng)為各菜單項(xiàng)...
實(shí)現(xiàn)方法:(用VS.net的可視化實(shí)現(xiàn))
新建一個項(xiàng)目(notifyicon)
把右鍵菜單(contextmenu)拖入表單中.加入菜單的子菜單項(xiàng)。比如“顯示”、“隱藏”等菜單項(xiàng)。
雙擊各菜單項(xiàng)為各菜單項(xiàng)加入單擊事件。
比如:(顯示)me.show
 (隱藏)me.hide
把托盤控件拖入表單中。設(shè)置其顯示文字(.text)、圖標(biāo)文件(icon)
設(shè)置托盤的右鍵菜單(contextmenu)為你剛才創(chuàng)建的菜單。
這樣就很方便的實(shí)現(xiàn)以前VB需要好多的Win API才能實(shí)現(xiàn)的功能。

附上該form的源代碼
Public Class notifyIcon
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents NotifyIcon1 As System.Windows.Forms.NotifyIcon
Friend WithEvents ContextMenu1 As System.Windows.Forms.ContextMenu
Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(notifyIcon))
Me.Button1 = New System.Windows.Forms.Button()
Me.NotifyIcon1 = New System.Windows.Forms.NotifyIcon(Me.components)
Me.ContextMenu1 = New System.Windows.Forms.ContextMenu()
Me.MenuItem1 = New System.Windows.Forms.MenuItem()
Me.MenuItem2 = New System.Windows.Forms.MenuItem()
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(128, 48)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(88, 24)
Me.Button1.TabIndex = 0
Me.Button1.Text = "Button1"
'
'NotifyIcon1
'
Me.NotifyIcon1.ContextMenu = Me.ContextMenu1
Me.NotifyIcon1.Icon = New System.Drawing.Icon("C:\root.ico")
Me.NotifyIcon1.Text = "NotifyIcon and ContextMenu"
Me.NotifyIcon1.Visible = True
'
'ContextMenu1
'
Me.ContextMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem2})
'
'MenuItem1
'
Me.MenuItem1.Index = 0
Me.MenuItem1.Text = "顯示"
'
'MenuItem2
'
Me.MenuItem2.Index = 1
Me.MenuItem2.Text = "隱藏"
'
'notifyIcon
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 273)
Me.Name = "notifyIcon"

End Sub

#End Region


Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
Me.Show()
End Sub

Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
Me.Hide()
End Sub
End Class




主站蜘蛛池模板: 先锋在线资源站 | 人人插人人爽 | 日韩亚洲制服丝袜中文字幕 | 伊人网2021 | 我想看一级毛片免费的 | 欧美一级免费看 | 日韩av东京社区男人的天堂 | 特级黄视频 | 色老头久久久久久久久久 | 日产精品卡二卡三卡四卡乱码视频 | 天天色天天色天天色 | 欧美视频区 | 日黄网站| 热e国产| 侵犯希崎中文字幕在线 | 日本一区二区三区精品 | 亚洲成a人片77777kkkk | 热久久久久久久 | 四虎影视永久免费观看网址 | 日韩欧美系列 | 亚洲成人精品 | 天天干天天插天天操 | 亚洲综合小说网 | 天天看片日日夜夜 | 欧美一区二区亚洲 | 青青草国产免费久久久91 | 四虎永久免费在线观看 | 欧美又大粗又爽又黄大片视频黑人 | 日本高清视频一区 | 无码免费一区二区三区免费播放 | 伊人影院亚洲 | 亚洲婷婷综合中文字幕第一页 | 日韩免费视频一区 | 日本www免费 | 日本免费三区 | 青春草在线视频免费 | 伊人a.v在线 | 四虎精品| 手机在线精品视频每日更新 | 欧美一区二区三区不卡免费 | 午夜视频福利在线 |