我现在使用的办法是用一个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类~

解决方案 »

  1.   

    我现在使用的办法是用一个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类~
      

  2.   

    谢谢~ 希望想知道的XDJM们也帮忙顶一下~ 呵呵~  : )
      

  3.   

    参考一下内存转换Image到Icon格式
    http://www.csdn.net/develop/Read_Article.asp?Id=25042
      

  4.   

    你用imagelist是不行的,因为加到这里面的东西都成了image而不是icon,所以你这样用就行了:Icon tmpIcon1=new Icon(...)
    Icon tmpIcon2=new Icon(...)
    if(blCondition)
       {
         this.notifyIcon.Icon=tmpIcon1;
       }
       else
       {
         this.notifyIcon.Icon=tmpIcon2;
       }这样就一定没有问题了:)
      

  5.   

    要用Timer控件,在触发OnTick事件时更换NotifyIcon对象的Icon属性就可以了
      

  6.   

    为什么结帖了还可以回复~?疑惑ing~