C#版的仿造QQ图标闪烁

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

namespace 仿造QQ图标闪烁
{
    
public partial class Form1 : Form
    {
        
public Form1()
        {
            InitializeComponent();
        }
        
private Icon ico1 = new Icon("MOON01.ICO");
        
private Icon ico2 = new Icon("MOON02.ICO");
        
private Icon ico3 = new Icon("MOON03.ICO");
        
private Icon ico4 = new Icon("MOON04.ICO");
        
private Icon ico5 = new Icon("MOON05.ICO");
        
private Icon ico6 = new Icon("MOON06.ICO");
        
//private Icon ico7 = new Icon("MOON07.ICO");
        
//private Icon ico8 = new Icon("MOON08.ICO");
        
//用语存放以上的实例
        private ArrayList ay = new ArrayList();
        
private int i = 0;

        
private void Form1_Load(object sender, EventArgs e)
        {
            
//窗口起始状态
            this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
            
//窗体完全透明,这个可要可不要。.
            
//   this.Opacity = 0;
            
//不显示在任务栏
            this.ShowInTaskbar = false;
            
//将所有ICO对象放进集合中
            ay.Add(ico1);
            ay.Add(ico2);
            ay.Add(ico3);
            ay.Add(ico4);
            ay.Add(ico5);
            ay.Add(ico6);
            
//ay.Add(ico7);
            
//ay.Add(ico8);
            
//timer时间间隔
            this.timer1.Interval = 100;
            
this.notifyIcon1.Icon = ico1;
           

        }

        
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
        {

        }

        
//private void notifyIcon1_MouseUp(object sender, MouseEventArgs e)
        
//{
        
//    //得到右健菜单
        
//    contextMenu1.GetContextMenu();
        
//}

        
private void 开始ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
//开始记时
            this.timer1.Enabled = true;

        }

        
private void 开始ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            
//开始记时
            this.timer1.Enabled = true;

        }

        
private void timer1_Tick(object sender, EventArgs e)
        {
            
//ICO转换控制。
            if (i < 5)
            {
                notifyIcon1.Icon 
= (Icon)ay;
                i
++;
                
return;
            }
            
else
                notifyIcon1.Icon 
= (Icon)ay[0];
            i 
= 1;

        }

        
private void 停止ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
//停止记时
            this.timer1.Enabled = false;

        }

        
private void 停止ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            
//停止记时
            this.timer1.Enabled = false;

        }

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

        
private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {

            Application.Exit();
        }
    }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值