• paip.c#.nett 系统托盘动态图标闪烁图标


    paip.c#.nett 系统托盘动态图标闪烁图标




    作者Attilax ,  EMAIL:1466519819@qq.com




    思路:
    抛个线程来定时切换notifyIcon1.Icon。类似QQ的闪烁时间在400MS左右。。




    代码如下




         NotifyIcon notifyIcon1 = new NotifyIcon();
                notifyIcon1.Icon= new System.Drawing.Icon(pathC23.appPathDisk()+"\\APTN.ico");
                notifyIcon1.Icon = new System.Drawing.Icon(pathC23.appPathDisk() + "\\APk.ico");
                      //设置鼠标放在托盘图标上面的文字
                notifyIcon1.Text = "心语托盘图标";
                notifyIcon1.Visible = true;
















    //c452308 add txt2list
    Thread t = new Thread(new ParameterizedThreadStart(
    delegate(object obj)
    {
         Icon icon1 = new System.Drawing.Icon(pathC23.appPathDisk() + "\\APTN.ico"); 
            Icon icon2=new System.Drawing.Icon(pathC23.appPathDisk() + "\\APk.ico");
        while (1==1)
        {
           
            Thread.Sleep(400);
            if (notifyIcon1.Icon == (icon1))
                notifyIcon1.Icon = icon2;
            else


                notifyIcon1.Icon = icon1;


        }
     


    }));
    t.Name = " --start tray thread";
    t.IsBackground = true;
    t.Priority = ThreadPriority.Lowest;
    t.Start(null);





  • 相关阅读:
    函数【二】嵌套/作用域/名称空间
    内核模块加载错误 “Invalid module format” 解决办法
    linux oops调试
    linux 工具
    makefile 嵌套
    scheduling while atomic 出现的错误
    Windows下VSCode编译调试c/c++
    window markdown 编辑器
    linux 比较命令
    openwrt 加入nand flash的支持
  • 原文地址:https://www.cnblogs.com/attilax/p/15199680.html
Copyright © 2020-2023  润新知