如何在窗体中连续更改任务栏图标 [英] How to Change the taskbar icon Continuously in Form
问题描述
大家好
我想连续更改任务栏上的图标.
意思是:
在Skype中,当您收到一条消息时,任务栏上的图标将更改,并显示带有Skype徽标的数字1;当我们打开Skype并看到该消息时,该1位数字将不可见.
我想以我的形式实现它.
请帮助我实施此操作.
在此先感谢..
Hi All
I want to change the icon on the task bar continuously.
Means:
In skype when u got a message the icon on the task bar changed and show digit 1 with the skype logo and when we open the skype and see the message the 1 digit is invisible .
I want to implement this in my form .
Please Help me to implement this.
Thanks in advance..
推荐答案
int i= 1;
//in button click event
if (i == 1){
this.Icon = WindowsFormsApplication1.Properties.Resources.Icon1;
i = 2}
else
{this.Icon = WindowsFormsApplication1.Properties.Resources.Icon2;
i = 1;}
这样,您可以更改图标.
要测试此代码,只需创建一个表单并添加一个按钮.在按钮的click事件中,添加提供的代码.
然后在项目中创建2个图标并运行.
This way u can change the icons.
To test this code, simply create a form and add a button. In the button''s click event add the provided code.
then create 2 icons in the project and run.
这篇关于如何在窗体中连续更改任务栏图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!