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();//启动闪烁
本文介绍了一种通过更改系统托盘图标的实现方式来达到图标闪烁效果的方法。利用线程循环更新图标,并通过判断是否需要调用委托来刷新显示。
961

被折叠的 条评论
为什么被折叠?



