473,395 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

WinForms.NotifyIcon doesn't vanish when program ends

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!

Jan 13 '07 #1
2 2215
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.

Fo**********@gmail.com wrote:
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!
Jan 13 '07 #2
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

Jan 14 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Phil Galey | last post by:
VB.NET 2002 on Windows 2000 SP 3 When I start my program, the NotifyIcon appears in the tray, as it should. However, when I close the program, the NotifyIcon remains until I hover over it with...
0
by: petterl | last post by:
I have tried to find the error in the code below but I always get " An unhandled exception of type 'System.NullReferenceException' occurred in Unknown Module. Additional information: Object...
2
by: Rob Mayo | last post by:
OK, maybe this is my opinion, maybe these are bugs. Given the folowing: I have a NotifyIcon on my Form, a Context menu associated with the NotifyIcon, and a MenuItem on the ContextMenu set as...
0
by: Mike Allen | last post by:
Hi Everyone, My problem concerns ContextMenus. It's easy enough to create one and apply it to a NotifyIcon. When it's compiled and run, it works beautifully. Right click and there you are. But I...
10
by: james | last post by:
My app has a notify Icon, but after the app exits, the Icon is still visible, and then when I runthe app multiple times I get multiple icons so that my status bas keeps accumulating them to the...
8
by: bole2cant | last post by:
When I add a Button to my NotifyIcon program I get the following: An unhandled exception of type 'System.NullReferenceException' occurred in unknown module. Additional information: Object...
2
by: Erik Cole | last post by:
There doesn't seem to be a mouseover event for the notifyicon, but I want to fire an event that shows the user an updated status message on mouseover...sort of like hovering over the network icon...
2
by: deciacco | last post by:
I have a NotifyIcon application. (c# 2) I want to be able to catch a kill/shutdown attempt so that I can call Dispose() to remove the icon. I tried to create an event handler for ApplicationExit...
1
by: Iceman | last post by:
I have two windows forms. (A and B). A contains an instance of B A and B are both invisible at program startup. A sits in the Taskbar at program startup with a NotifyIcon. When the NotifyIcon...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.