Paip. c #. nett System Tray dynamic icon flashing icon
Ideas:
Throw a thread to regularly switch yyicon1.icon. The flash time of QQ is around Ms ..
The Code is as 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 );