WinForms.NotifyIcon doesn't vanish when program ends

F

ForrestPhoto

I would think it should disappear on its own when the application ends
- if you have a main form and others, they'll all close when the user
kills the main form. In any case, I override the OnClosing method and
set notifyicon1.Visible = false, but still, after my program ends, the
icon is left behind in the notification area.

I've seen the same thing pretty often with SQL Server Management Studio
2005. Is this just a bug inherent to that control, or is there
something I can do about it?

Thanks!
 
B

Bob Powell [MVP]

You have to actively remove the notify icon during your ordered program
shutdown otherwise it stays there. Actually this is common if
undesirable behaviour for many programs.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
F

ForrestPhoto

You have to actively remove the notify icon during your ordered program
shutdown otherwise it stays there. Actually this is common if
undesirable behaviour for many programs.

I noticed this is pretty common; it happens with the out-of-the-box
IDE for SQL. I tried making a public method of the main form, and then
calling it as one of the last statements in Program.cs:main() and it
works beautifully. Thanks! This was the last thing holding me back
from a new beta release of an FTP client I've been writing:
http://forrestcroce.com/Software/WebMaestro.html


Forrest
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top