定时器,不断地更新图标。==================================================================
博客空间:http://blog.csdn.net/lovingkiss
资源下载:http://download.csdn.net/user/lovingkiss
优惠接单开发,组件控件定制开发,成品源代码批发
联系方式:Q64180940 全天在线
==================================================================
博客空间:http://blog.csdn.net/lovingkiss
资源下载:http://download.csdn.net/user/lovingkiss
优惠接单开发,组件控件定制开发,成品源代码批发
联系方式:Q64180940 全天在线
==================================================================
右键资源管理器--添加现有项目(添加一个名为123的GIF图片)
选中图片,在属性栏中把“生成操作”设为“嵌入的资源”
代码:
System.Reflection.Assembly thisExe;
thisExe = System.Reflection.Assembly.GetExecutingAssembly();
//WindowsApplication1为程序集的命名空间
//123.GIF为图片的名字
System.IO.Stream file = thisExe.GetManifestResourceStream("WindowsApplication1.123.jpg");
this.pictureBox1.Image = Image.FromStream(file);
{
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();//启动闪烁