Paip. C #. Nett System Tray dynamic icon flashing icon
Author attilax, email: 1466519819@qq.com
Ideas:
Throw a thread to regularly switch yyicon1.icon. The flash time of QQ is around Ms ..
CodeAs follows:
Policyicon policyicon1 = new policyicon ();
Policyicon1.icon = new system. Drawing. Icon (pathc23.apppathdisk () + "\ APTN. ICO ");
Notifyicon1.icon = new system. Drawing. Icon (pathc23.apppathdisk () + "\ APK. ICO ");
// Set the text that you place the cursor over the tray icon
Policyicon1.text = "Xinyu tray icon ";
Policyicon1.visible = true;
// C452308 add txt2list
Thread t = new thread (New parameterizedthreadstart (
Delegate (Object OBJ)
{
Icon icon1 = new system. Drawing. Icon (pathc23.apppathdisk () + "\ APTN. ICO ");
Icon icon2 = new system. Drawing. Icon (pathc23.apppathdisk () + "\ APK. ICO ");
While (1 = 1)
{
Thread. Sleep (400 );
If (policyicon1.icon = (icon1 ))
Policyicon1.icon = icon2;
Else
Policyicon1.icon = icon1;
}
}));
T. Name = "-- start tray thread ";
T. isbackground = true;
T. Priority = threadpriority. Lowest;
T. Start (null );