教程集 www.jiaochengji.com
教程集 >  操作系统  >  windows  >  正文 关于任务栏式的托盘图标及其右键菜单的实现!

关于任务栏式的托盘图标及其右键菜单的实现!

发布时间:2019-12-15   编辑:jiaochengji.com
教程集为您提供关于任务栏式的托盘图标及其右键菜单的实现!等资源,欢迎您收藏本站,我们将为您提供最新的关于任务栏式的托盘图标及其右键菜单的实现!资源
实现方法:(用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

您可能感兴趣的文章:
关于任务栏式的托盘图标及其右键菜单的实现!
C#下实现动态系统托盘图标
Win7任务栏变成白色Aero主题不能用及如何还方形图标教程
ASP.NET控件利用Control.ContextMenu加入快捷菜单
电脑键盘快捷键大全有那些?盘快捷键使用大全
电脑桌面图标右键没有锁定到任务栏是什么原因
如何阻止Windwos XP系统蓝屏
电脑怎么恢复任务栏?任务栏变宽了怎么办
C# Builder 实现POP3信箱的监视
Win8.1任务栏出现在屏幕的右侧怎么办?电脑任务栏在右边解决方法

[关闭]
~ ~