NotifyIcon stays at sys tray

  • Thread starter Thread starter Nassos
  • Start date Start date
N

Nassos

Hi All,
Does anybody found a way to remove the notifyIcon form the systemTray after
the program has closed!?
Mine is stay on the sysTray and is removed after the mouse pointed at it.
thx in advance
 
Hi jani,
first of all, thanks for the reply, What i mean is that the hole project is
closed and the icon is still showing in the tray, tryed what you suggest in
the Form Closing event but the notifyIcon is disposed so i had an exception,
is there a API function or even better a NET function to handle the
systemTray.
Thanx in advance
Regards,
Nassos.
 
Hi!
What i mean is that the hole project is closed and the icon is still
showing in the tray, tryed what you suggest in the Form Closing event but
the notifyIcon is disposed so i had an exception

Okay, I see. What *should* happen is that the icon from the tray should
disappear automatically. At least this is what happens when when you
visually drop a NotifyIcon component on your main form. This way, you don't
need to write code to hide the icon.

However it seems to me that you are manually (in your own code that is)
creating an instance of the NotifyIcon class. Depending on where and how you
do this, you might need to manually hide the icon, too. But even if you were
creating the icon yourself, I would assume the icon would get hidden anyway.

Are you sure your application is not crashing? If it does, then the icon
will stay as you mentioned and be removed when you move your mouse over the
icon.

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
(e-mail address removed)
http://www.saunalahti.fi/janij/
 
Explicityly remove the icon from the tray using Visible = False when your
app is about to close.

Atul Godbole
http://www.ssware.com/
Shell MegaPack - Windows Explorer Shell Controls for ActiveX and .Net
 
Back
Top