<cite id="lbrnp"></cite>

<ins id="lbrnp"><form id="lbrnp"></form></ins>
<delect id="lbrnp"></delect>

<delect id="lbrnp"><track id="lbrnp"><cite id="lbrnp"></cite></track></delect>

<delect id="lbrnp"><form id="lbrnp"></form></delect>

      <delect id="lbrnp"></delect>

        <ins id="lbrnp"><form id="lbrnp"><delect id="lbrnp"></delect></form></ins>

          三度網教程:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

          對于任務欄式的托盤圖標及其右鍵菜單的完成!

          時間:2023-9-14作者:未知來源:三度網教程人氣:


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

          附上該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

          關鍵詞:  對于任務欄式的托盤圖標及其右鍵菜單的完成!





          Copyright © 2012-2018 三度網教程(http://www.shuofei.net) .All Rights Reserved 網站地圖 友情鏈接

          免責聲明:本站資源均來自互聯網收集 如有侵犯到您利益的地方請及時聯系管理刪除,敬請見諒!

          QQ:1006262270   郵箱:kfyvi376850063@126.com   手機版 

          小红书a v,亚洲精品无码A V片一区二区三区发表贴子国产精品国产精品一区精品国产自在现偷99精品国产在热2023国产拍偷精品网国产精品视频全国免费观看亚洲精品无码A V片一区二区三区相关贴推荐最热最新38卖23一区的v3和二区的v5以后转战A V饭了一区的50块(卡没动)二区的100块国产精品国产精品一区精品国产自在现偷99精品国产在热2023国产拍偷精品网国产精品视频全国免费观看,亚洲国产成人精品久久久999精品国产精品v欧美精品v日韩精品青青精品视频国产久久国产精品久久精品国产亚洲精品国产精品国产欧美精品一区二区三区久久久国产亚州高清国产拍精品女人和拘做受全程看视频欧美一级黄色片亚洲国产成人久久综合碰碰动漫3d午夜一级毛片国产精品v欧美精品v日韩精品青青精品视频国产久久国产精品久久精品国产亚洲精品国产精品国产欧美精品一区二区三区国产精品第一页国产亚洲精品国产福利国产精品自拍国产精品视频在线观看亚洲国产精品一区二区久久国产精品国产三级国产专不,99久久无码一区人妻99久久九九社区精品国产精品第一页国产亚洲精品国产福利国产精品自拍国产精品视频在线观看亚洲国产精品一区二区久久国产精品国产三级国产专不99久久精品免费看国产99久久精品免费观看国产一级亚洲色惰片丁香久久最新欧美交换配乱婬粗大视频视频一区国产自拍日本无码国产精品视频大陆精大陆国产国语精品2023精品国产品对白在线23年香蕉精品国产高清自在自线隔壁老王国产在线精品在线观看精品国产福利片,无码国产精品一区二区免费式影视久久国产精品视频大陆精大陆国产国语精品2023精品国产品对白在线65年香蕉精品国产高清自在自线隔壁老王国产在线精品在线观看精品国产福利片国产精品狼人亚洲国产精品久久精品久久国产菠萝在线视频国产精品尤物极品在线国精品国产亚洲第一区99久久精品国产百合国产精品视频大陆精大陆国产国语精品2023精品国产品对白在线50年香蕉精品国产高清自在自线隔壁老王国产在线精品在线观看精品国产福利片,国产三级精品三级在专区精品国产自在现偷国产精品一区二区三区国产日韩精品欧美一区喷水亚洲精品国产精品国自产国产在线精品一区二区不卡精品国产一区二区三区A V蜜桃人体艺术写真国产精品水蜜桃精品无码久久久久久国产三级精品三级在专区精品国产自在现偷国产精品一区二区三区国产日韩精品欧美一区喷水亚洲精品国产精品国自产国产在线精品一区二区不卡国产中文字幕在线观看国产性一乱一性一伧国产日产欧产美又大又黄欧美人妖