使用timer控件修改窗口的Icon属性即可,示例代码如下:
int iconid = 1; //当前图标ID
private void timer1_Tick(object sender, EventArgs e)
{
if (iconid == 1)
{
this.Icon = TestCSForm.Properties.Resources.icon2;
iconid = 2;
}
else if (iconid == 2)
{
this.Icon = TestCSForm.Properties.Resources.icon3;
iconid = 3;
}
else if (iconid == 3)
{
this.Icon = TestCSForm.Properties.Resources.icon4;
iconid = 4;
}
else
{
this.Icon = TestCSForm.Properties.Resources.icon1;
iconid = 1;
}
}
效果如下:
我要动态改变这个图标,就是10个不一样的图标不停的轮换,请问如何实现,我新手!
那么,你会不会用代码设置一个固定的图标?或者会不会用Timer控制其他属性不停轮换?