zoukankan      html  css  js  c++  java
  • 【Vegas改编】Winform最小化,系统托盘出现图标,并气泡显示tip

    环境: C# C/S

    DEMO:

    image

    做法:

    1,在Winform中拖进notifyIcon控件;

    2,更改icon图标、Text内容;

    3,在Click事件中添加:

    private void notifyIcon1_Click(object sender, EventArgs e)
     {
         if (this.Visible == false)
         {
             this.Visible = true;
     
             this.WindowState = FormWindowState.Normal;
     
             this.notifyIcon1.Visible = false;
         }
     }

    4,在Form窗口添加Resize事件:

    private void frmServerWatch_Resize(object sender, EventArgs e)
        {
            if (this.WindowState == FormWindowState.Minimized)
            {
                this.Visible = false;
                this.notifyIcon1.Visible = true;
     
                notifyIcon1.BalloonTipTitle = "PACS OS Monitor";
                notifyIcon1.BalloonTipText = "程序最小化,仍继续运行......" + "\r\n" + "单击托盘图标还原窗口.";
                notifyIcon1.ShowBalloonTip(10);//消失时间
            }
        }

    5,Try!

    喜欢请赞赏一下啦^_^
  • 相关阅读:
    php 将网页执行的输出写入到本地文件中
    网络爬虫技术
    解决:解压zip文件却变成cpgz文件
    SHA1算法实现及详解
    Mac配置PHP开发环境
    项目管理
    Oracle Primavera P6 R84单机版安装教程
    工时
    项目管理软件伙伴https://www.huobanyun.cn/
    Primavera 6.0
  • 原文地址:https://www.cnblogs.com/amadeuslee/p/3744169.html
Copyright © 2011-2022 走看看