• 大小: 62KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-06
  • 语言: 其他
  • 标签: c#  notifyicon  

资源简介

右下角图标显示并加上右键菜单,图标的闪烁效果及气泡提醒效果

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NotifyIconTest
{
    public partial class Form1 : Form
    {
        private Icon blank = Properties.Resources.blank;
        private Icon normal = Properties.Resources.normal;
        private bool _status = true;
        private bool _isblink = false;

        public Form1()
        {
            InitializeComponent();
        }

        private void 显示ToolStripMenuItem_Click(object sender EventArgs e)
        {
            this.Show();
        }

        private void 隐藏ToolStripMenuItem_Click(object sender EventArgs e)
        {
            this.Hide();
        }

        private void toolStripMenuItem1_Click(object sender EventArgs e)
        {
            if (_isblink == false)
            {
                _isblink = true;
                timer1.Enabled = true;
                timer1.Start();
            }
            else
            {
                _isblink = false;
                timer1.Stop();

                notifyIcon1.ShowBalloonTip(5000 “提示“ “关闭闪烁效果!“ ToolTipIcon.Info);
            }
        }

        private void 退出ToolStripMenuItem_Click(object sender EventArgs e)
        {
            Application.Exit();
        }

        private void timer1_Tick(object sender EventArgs e)
        {
            if (_status)
                notifyIcon1.Icon = normal;
            else
                notifyIcon1.Icon = blank;

            _status = !_status;
        }


    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      57856  2016-04-07 10:31  NotifyIconTest\NotifyIconTest\bin\Debug\NotifyIconTest.exe

     文件      28160  2016-04-07 10:31  NotifyIconTest\NotifyIconTest\bin\Debug\NotifyIconTest.pdb

     文件      11600  2016-04-07 10:36  NotifyIconTest\NotifyIconTest\bin\Debug\NotifyIconTest.vshost.exe

     文件        490  2010-03-17 22:39  NotifyIconTest\NotifyIconTest\bin\Debug\NotifyIconTest.vshost.exe.manifest

     文件       1708  2016-04-07 10:31  NotifyIconTest\NotifyIconTest\Form1.cs

     文件       5833  2016-04-07 10:28  NotifyIconTest\NotifyIconTest\Form1.Designer.cs

     文件      13155  2016-04-07 10:28  NotifyIconTest\NotifyIconTest\Form1.resx

     文件       4004  2016-04-07 10:29  NotifyIconTest\NotifyIconTest\NotifyIconTest.csproj

     文件       2855  2016-04-07 09:51  NotifyIconTest\NotifyIconTest\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6680  2016-04-07 10:31  NotifyIconTest\NotifyIconTest\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        827  2016-04-07 10:36  NotifyIconTest\NotifyIconTest\obj\x86\Debug\NotifyIconTest.csproj.FileListAbsolute.txt

     文件       1091  2016-04-07 10:29  NotifyIconTest\NotifyIconTest\obj\x86\Debug\NotifyIconTest.csproj.GenerateResource.Cache

     文件      57856  2016-04-07 10:31  NotifyIconTest\NotifyIconTest\obj\x86\Debug\NotifyIconTest.exe

     文件       4864  2016-04-07 10:29  NotifyIconTest\NotifyIconTest\obj\x86\Debug\NotifyIconTest.Form1.resources

     文件      28160  2016-04-07 10:31  NotifyIconTest\NotifyIconTest\obj\x86\Debug\NotifyIconTest.pdb

     文件      43202  2016-04-07 10:29  NotifyIconTest\NotifyIconTest\obj\x86\Debug\NotifyIconTest.Properties.Resources.resources

     文件       5120  2016-04-07 10:12  NotifyIconTest\NotifyIconTest\obj\x86\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件        495  2016-04-07 09:50  NotifyIconTest\NotifyIconTest\Program.cs

     文件       1360  2016-04-07 09:50  NotifyIconTest\NotifyIconTest\Properties\AssemblyInfo.cs

     文件       3634  2016-04-07 10:12  NotifyIconTest\NotifyIconTest\Properties\Resources.Designer.cs

     文件       6472  2016-04-07 10:12  NotifyIconTest\NotifyIconTest\Properties\Resources.resx

     文件       1101  2016-04-07 09:50  NotifyIconTest\NotifyIconTest\Properties\Settings.Designer.cs

     文件        249  2016-04-07 09:50  NotifyIconTest\NotifyIconTest\Properties\Settings.settings

     文件      38078  2013-05-29 11:13  NotifyIconTest\NotifyIconTest\Resource\blank.ico

     文件       4286  2016-04-07 10:03  NotifyIconTest\NotifyIconTest\Resource\com_popcap_pvz_icon_32px_1127531_easyicon.net.ico

     文件       1078  2016-04-07 10:11  NotifyIconTest\NotifyIconTest\Resources\blank.ico

     文件        884  2016-04-07 09:51  NotifyIconTest\NotifyIconTest.sln

    ..A..H.     11264  2016-04-07 10:11  NotifyIconTest\NotifyIconTest.suo

     目录          0  2016-04-07 10:12  NotifyIconTest\NotifyIconTest\obj\x86\Debug\TempPE

     目录          0  2016-04-07 10:31  NotifyIconTest\NotifyIconTest\obj\x86\Debug

............此处省略12个文件信息

评论

共有 条评论