icon problem in taskbar

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

Dear my friends,

I have been helped by many C# gurus here, thank you very much.
My small application can help you fetch some good pictures from Internet.
You can get it from
http://members.rogers.com/5725brian/i_want_images/IWantImages1.0.zip. No
virus guarantee, nothing will harm your computer, trust me. Have fun to use
it.
But I still have some simple questions. When I run this program, it will
display a icon on taskbar. But this icon won't disappear itself even the
program has already exited if you won't use mouse to over it. How to fix
this problem?
And, if I want to keep this icon staying at taskbar when the program is
running, like yahoo messenger, how to do?
Thanks again.

Brian
 
Brian,

You need to explicitly clean up your system tray icon on a close event (or
Exit from a menu or something) of your application. If your application is a
single dialog form, catch the Close event and clean up your tray icon. To
keep the app running when a user clicks close, you need to catch the Close
event and tell it to cancel the close and hide your form. This will keep
your application running, your icon in the system tray, and no taskbar
button.

Goodluck!

Adam
 
To get rid of the icon when the app closes, catch the form's Close event.
In the event handler, call "this.Dispose();".

Cletus
 
Back
Top