Dear Friends, Here iam facing the Typical problem with notify icon.Here i have Developed a windows application that is Modem Device Detector.Main theme of the Applicaion is when i put any Modem to my CPU.Notify icon message will come, Modem connected sucessfully.When i remove the Modem,Modem disconnected Message will come through Notify icon Up to now this is fine.But When i Disconnected the Modem the Connected Notify icon is still in Active.So i dont know how to Remove the Instance of the Notify IconSample Code: This is when Modem Connected eventNotifyIcon notifyIcon2 = new NotifyIcon();notifyIcon2.Icon = SystemIcons.Exclamation;notifyIcon2.BalloonTipTitle = "SmsService Running...";notifyIcon2.BalloonTipText = "Gsm Modem connected Successfully";notifyIcon2.BalloonTipIcon = ToolTipIcon.Info;notifyIcon2.Icon = new Icon("Running.ico");notifyIcon2.Visible = true;notifyIcon2.ShowBalloonTip(1);notifyIcon2.Text = "Modem Connected" + e.Drive;This is When Modem Disconnected event NotifyIcon notifyIcon3 = new NotifyIcon();notifyIcon3.Icon = SystemIcons.Exclamation;notifyIcon3.BalloonTipTitle = "SmsService Stopped..";notifyIcon3.BalloonTipText = "Gsm Modem Disconnected Successfully";notifyIcon3.BalloonTipIcon = ToolTipIcon.Info;notifyIcon3.Icon = new Icon("Stopped.ico");notifyIcon3.Visible = true;notifyIcon3.ShowBalloonTip(1);notifyIcon3.Text = "Modem DisConnected" + e.Drive;scrTemp.Stop();scrTemp.Refresh();notifyIcon3.Dispose();notifyicon2.Dispose();Even the notifyicon is in ACTIVE Still i have used Dispose Concept.please share any information Regarding this.Regards,AnilKumar.D 解决方案 这篇关于如何在整个Windows应用程序中保存对象实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
06-06 01:54