我现在使用的办法是用一个Timer定时检测条件是否满足~ 然后执行类似下面的代码:
if(blCondition)
{
this.notifyIcon.Icon=(System.Drawing.Icon)this.imageList.Images[0];
}
else
{
this.notifyIcon.Icon=(System.Drawing.Icon)this.imageList.Images[1];
}但系统提示无法将System.Drawing.Image类转化为System.Drawing.Icon类~
if(blCondition)
{
this.notifyIcon.Icon=(System.Drawing.Icon)this.imageList.Images[0];
}
else
{
this.notifyIcon.Icon=(System.Drawing.Icon)this.imageList.Images[1];
}但系统提示无法将System.Drawing.Image类转化为System.Drawing.Icon类~
if(blCondition)
{
this.notifyIcon.Icon=(System.Drawing.Icon)this.imageList.Images[0];
}
else
{
this.notifyIcon.Icon=(System.Drawing.Icon)this.imageList.Images[1];
}但系统提示无法将System.Drawing.Image类转化为System.Drawing.Icon类~
http://www.csdn.net/develop/Read_Article.asp?Id=25042
Icon tmpIcon2=new Icon(...)
if(blCondition)
{
this.notifyIcon.Icon=tmpIcon1;
}
else
{
this.notifyIcon.Icon=tmpIcon2;
}这样就一定没有问题了:)