Reputation: 41
I am developing one desktop application which allow to create notification on desktop bar when this application is in running mode and also new customer come into system. for-that, i made one WCF service which can communicate with database and also build desktop application this requirement works fine. now i want to make one icon which turn into red when new count is coming into system otherwise it will remain red.
C# Code:
protected void Displaynotify()
{
try
{
int i=0, j=1;
long k = 0;
for (i = 0; i < j; i++)
{
ServiceReference1.Service1Client vc = new ServiceReference1.Service1Client();
p = vc.GetNotoficationCnt();
if (k != p)
{
notifyIcon1.Icon = new System.Drawing.Icon(Path.GetFullPath(@"E:\TerryBerry_Current_Working_Cpy\branches\NotificationDeskopApplication\image\Terryberry_weblogo.ico"));
notifyIcon1.Text = "Export Datatable Utlity";
notifyIcon1.Visible = true;
notifyIcon1.BalloonTipTitle = "Your Lead Count is:" + p + "";
notifyIcon1.BalloonTipText = "Click Here to see details";
notifyIcon1.ShowBalloonTip(100);
k = p;
}
else
{
}
j++;
}
}
catch (Exception ex)
{
}
}
Upvotes: 1
Views: 856
Reputation: 146
Just set the NotifyIcon.Icon property to the new icon to change it.
Upvotes: 1