private void Wacher()
{
this.m_Icon = null;
this.m_Icon = new Icon( "ico//Icon3.ico ");
if (this.InvokeRequired)
{
this.BeginInvoke(new EventHandler(ShowWacher));
}
Thread.Sleep(750);
this.m_Icon = new Icon( "ico//Icon2.ico ");
if (this.InvokeRequired)
{
this.BeginInvoke(new EventHandler(ShowWacher));
}
Thread.Sleep(750);
this.m_Icon = new Icon( "ico//Icon1.ico ");
if (this.InvokeRequired)
{
this.BeginInvoke(new EventHandler(ShowWacher));
}
}
//上面代码在一个线程中循环的话就可以不停的闪烁了
private void ShowWacher(object sender, System.EventArgs e)
{
this.notifyIcon1.Icon = this.m_Icon; //notifyIcon1系统托盘
}
worker = new Thread(new ThreadStart(Wacher));
worker.Start();//启动闪烁