Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have been using the NotifyIcon with one of my app for some time. I have made no changes to any of it's events or usage, but I see the icon getting added to the tray every minute , but not always the same time frame. When I hover the mouse over the new icon they simply disappear - very annoying and unprofessional look. Any ideas?
Posted
Comments
Sergey Alexandrovich Kryukov 17-Jan-12 18:58pm    
No! There are millions of ways to screw up things -- how can we know which one happened to you?
--SA

Well, I can think of two things that would do this off the top of my head.

1) Your app puts up a tray icon, but then ends up crashing silently and relaunching somehow, creating another icon. I hope you're not doing this from a Windows Service app...

2) Your code is executing the code that instantiates the tray icon every so often and not properly disposing of the previous icon instance.
 
Share this answer
 
Comments
Idle_Force 18-Jan-12 0:43am    
1) crashing silently???,
2) the only code that reference the NotifyIcon is in the closing event.

No this is not a service, just a windows form app. I have not changed any code with it, just noticed this weird behavior. Just wondering if there is a form event that maybe interfering with it somehow. There is a timer, but the frequency does not match it and there is no code messing with it here.
Dave Kreskowiak 18-Jan-12 8:03am    
1) Windows Services can crash very silently and you won't notice unless you look in the event log. They can also be setup to auto-restart in the event of a failure.

2) There are no form events that can interfere with the tray icon unless you write code to do so.

3) Try it on a bare bones install, but fully patched, of the O/S that it's doing this on. If it happens there, you may have a patch issue, though I've never heard of anything like this happening with any app.
Idle_Force 18-Jan-12 9:08am    
Thanks Dave, so this behavior is occurring during debug. I have not installed this version on my computer that I am building on. I do the OS testing later, including installs. There was an old version on this machine, but has sense been uninstalled. One of the things I added was an Awaitable event (in this form) - which runs one time, so that does not sound like the culprit to me. In the end I may just delete the NotifyIcon and add it back and if that fixes it. Thanks for you helpful support.
It appears to be fixed. Strange indeed! It appears to be a bad method call in my FTP class - which has worked without problem for 2 years. I got rid of the test connection method and just Try/Catch the ftp object. Big thanks to Dave for being helpful and courteous.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900