Guidance:
I believe you have seen the flash effect on the taskbar during QQ message prompts. I found some related information on the Internet and found that using C # To achieve this effect is not very difficult, I only used a notifyicon (I guess it is called the taskbar tray control because I don't know what it is ). because I have not studied it in depth, I can only briefly introduce the basic usage to achieve the flickering effect. (In winform)
1. First, drag a yyicon control and a timing control into the blank form.
Private system. Windows. Forms. policyicon policyicon1;
Private system. Windows. Forms. Timer timer1;
2. secondly, we prepare two ICO images to display on the taskbar. One of them is a transparent ICO image, which is called 1. ICO and 2.ico; create two icon objects to store two ICO images respectively;
Private icon ico1 = new icon ("1.ico ");
Private icon ico2 = new icon ("2.ico"); // transparent icon
3. initialize policyicon in form_load:
Private void form1_load (Object sender, system. eventargs E)
{
This. policyicon1.icon = ico1; // setProgram Icon displayed on the taskbar at the moment of Running
This. timer1.enable = true; // set the scheduled control to enabled. The default value is false;
}
4. Set a global variable I to control the image index, create a scheduled event, and double-click the scheduled control to edit it.
Int I = 0;
Private void timerjavastick (Object sender, system. eventargs E)
{
// If I = 0, make the taskbar icon transparent and exit
If (I <1)
{
This. policyicon1.icon = ico2;
I ++;
Return;
}
// If I! = 0, the taskbar icon is changed to ico1, And I is set to 0;
Else
This. policyicon1.icon = ico1;
I = 0;
}
So far, we have completed the effect of flashing images; isn't it easy? If you want to implement a more powerful taskbar tray icon, you can add the menu function, because the menu control is involved, so we will not describe it here, and wait for the next write to improve this flashing effect ..