Hi guys,,
I have an app that I made, and every thing works ok, but when the application closes the notify icon in the task bar stays there, until i move the mouse over it, and it then it disappears. Is there a way I can refresh the taskbar area so that the icon is actually
remove after calling the this.notifyicon.dispose() method?
thanks alot
-
-
Every system tray icon I load up acts that way.
Still, there may be a way if you try hard enough... -
This is a
special featurebug of Windows XP. If you have any program with a taskbar icon and end it's process the icon remains. -
set notifyIcon.visible to false before closing the program.
-
How are you closing/ending the application?
I use a notify icon in somthing I just did and only when when testing it and I get an exception and I kill the process by stopping the debugger does it leave the icon in the notification area.
Other than that it goes away when my main form/application closes.
-
i close it using
Application.Exit ();
-
You can't get rid of the notifyIcon programatically if it crashes-- because the program crashed. If you point to it, it will go away. If you write your own exit method (a good idea anyways so you can do any cleanup or save files) which sets notifyIcon.visible=false, it will be gone when you close the application. Here's what it would look like:
/*Assume the notifyIcon is called notify1*/
public void exit(){
notify1.visible = false;
//other cleanup...
Application.Exit();
}
Call that instead of calling Application.Exit() directly, and you should be good.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.