Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Systray Icon not disposing correctly 1

Status
Not open for further replies.

mHos

Programmer
Mar 3, 2003
19
US
I have an app that uses a systray icon. When I exit the app, I notice that my icon is still in the systray. If I go to mouse over it, it disappears, so I know that it is actually gone. How can I force the systray to redraw so that the icon is no longer is visible?

thanks,
mHos
 
In the form closing event, try this:

Code:
NotifyIcon1.Icon.Dispose()

I hope this helps.

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.
 
I figured it out!!

I just needed to dispose of my icon before I exited my thread!!

Thanks,
mHos
 
Ron
Thanks for the reply, but I wasn't associating the sysTray Icon with a form, so I couldn't do it quite like that. I had added the disposing of the Icon to an overloaded Dispose event on my custom ApplicationContext class, but it wasn't being correctly called, so I just moved it so that it is called right before I close my thread.

Thanks for your prompt reply!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top