473,657 Members | 2,507 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

NotifyIcon Doesn't Disappear When Program Closes

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 my mouse. If I don't hover over it to make it disappear and then
open the program again, another one is added, resulting in a multiplicity of
the icon in the tray.

I've even tried setting its Visible property to false, followed by a call to
the Dispose method of the NotifyIcon in the Form1_Closing event, but the
NotifyIcon still remains when the program closes.

How can I get the NotifyIcon to disappear when I close my program? Thanks.
Jul 21 '05 #1
5 7356
Does it do this on all machines?

-smith

"Phil Galey" <pa*****@starca lif.com.nospam> wrote in message
news:eY******** ******@TK2MSFTN GP12.phx.gbl...
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 my mouse. If I don't hover over it to make it disappear and then
open the program again, another one is added, resulting in a multiplicity
of
the icon in the tray.

I've even tried setting its Visible property to false, followed by a call
to
the Dispose method of the NotifyIcon in the Form1_Closing event, but the
NotifyIcon still remains when the program closes.

How can I get the NotifyIcon to disappear when I close my program?
Thanks.

Jul 21 '05 #2
Simply explicitly remove the tray icon in the form closing event.
"Phil Galey" <pa*****@starca lif.com.nospam> wrote in message
news:eY******** ******@TK2MSFTN GP12.phx.gbl...
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 my mouse. If I don't hover over it to make it disappear and then
open the program again, another one is added, resulting in a multiplicity of the icon in the tray.

I've even tried setting its Visible property to false, followed by a call to the Dispose method of the NotifyIcon in the Form1_Closing event, but the
NotifyIcon still remains when the program closes.

How can I get the NotifyIcon to disappear when I close my program? Thanks.

Jul 21 '05 #3
I had previously attempted that method, i.e. explicitly referencing and
removing the icon from the tray. However, I was unable to determine how to
reference it. Do you know how it can be referenced? The word "Simply"
certainly sounds encouraging. Thanks.
"news.sbcglobal .net" <my********@pac bell.net> wrote in message
news:1E******** ***********@new ssvr14.news.pro digy.com...
Simply explicitly remove the tray icon in the form closing event.
"Phil Galey" <pa*****@starca lif.com.nospam> wrote in message
news:eY******** ******@TK2MSFTN GP12.phx.gbl...
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 my mouse. If I don't hover over it to make it disappear and then open the program again, another one is added, resulting in a

multiplicity of
the icon in the tray.

I've even tried setting its Visible property to false, followed by a
call to
the Dispose method of the NotifyIcon in the Form1_Closing event, but the
NotifyIcon still remains when the program closes.

How can I get the NotifyIcon to disappear when I close my program?

Thanks.


Jul 21 '05 #4
VB.Net:

Protected Overrides Sub OnClosing(ByVal e As
System.Componen tModel.CancelEv entArgs)

YourTrayIcon.Vi sible = False

YourTrayIcon.di spose 'propably don't need this.

End Sub

"Phil Galey" <pa*****@starca lif.com.nospam> wrote in message
news:Ox******** ******@TK2MSFTN GP12.phx.gbl...
I had previously attempted that method, i.e. explicitly referencing and
removing the icon from the tray. However, I was unable to determine how to reference it. Do you know how it can be referenced? The word "Simply"
certainly sounds encouraging. Thanks.
"news.sbcglobal .net" <my********@pac bell.net> wrote in message
news:1E******** ***********@new ssvr14.news.pro digy.com...
Simply explicitly remove the tray icon in the form closing event.
"Phil Galey" <pa*****@starca lif.com.nospam> wrote in message
news:eY******** ******@TK2MSFTN GP12.phx.gbl...
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 my mouse. If I don't hover over it to make it disappear and then open the program again, another one is added, resulting in a

multiplicity
of
the icon in the tray.

I've even tried setting its Visible property to false, followed by a

call
to
the Dispose method of the NotifyIcon in the Form1_Closing event, but

the NotifyIcon still remains when the program closes.

How can I get the NotifyIcon to disappear when I close my program?

Thanks.



Jul 21 '05 #5
Oh ... yea. That's what I did, as indicated in my initial posting (see
below). I thought you were saying you knew of a way of directly accessing
and removing icons in the System Tray.

But I think I discovered why NotifyIcon1.Vis ible = False in the OnClosing
event wasn't working. I was quitting the program from the VB.NET
development environment, so it wasn't triggering the OnClosing event.

Anyway, thanks.
"news.sbcglobal .net" <my********@pac bell.net> wrote in message
news:C_******** ***********@new ssvr14.news.pro digy.com...
VB.Net:

Protected Overrides Sub OnClosing(ByVal e As
System.Componen tModel.CancelEv entArgs)

YourTrayIcon.Vi sible = False

YourTrayIcon.di spose 'propably don't need this.

End Sub

"Phil Galey" <pa*****@starca lif.com.nospam> wrote in message
news:Ox******** ******@TK2MSFTN GP12.phx.gbl...
I had previously attempted that method, i.e. explicitly referencing and
removing the icon from the tray. However, I was unable to determine how

to
reference it. Do you know how it can be referenced? The word "Simply"
certainly sounds encouraging. Thanks.
"news.sbcglobal .net" <my********@pac bell.net> wrote in message
news:1E******** ***********@new ssvr14.news.pro digy.com...
Simply explicitly remove the tray icon in the form closing event.
"Phil Galey" <pa*****@starca lif.com.nospam> wrote in message
news:eY******** ******@TK2MSFTN GP12.phx.gbl...
> 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 my mouse. If I don't hover over it to make it disappear and

then
> open the program again, another one is added, resulting in a

multiplicity
of
> the icon in the tray.
>
> I've even tried setting its Visible property to false, followed by a

call
to
> the Dispose method of the NotifyIcon in the Form1_Closing event, but the > NotifyIcon still remains when the program closes.
>
> How can I get the NotifyIcon to disappear when I close my program?
Thanks.
>
>



Jul 21 '05 #6

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

Similar topics

0
1586
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 reference not set to an instance of an object." and then
2
513
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 default. When the default MenuItem is clicked, there is code to no longer show the NotifyIcon. What I feel should happen is when I double-click the NotifyIcon in the system tray, it should perform the default menu item's Click event.
149
25122
by: Christopher Benson-Manica | last post by:
(Followups set to comp.std.c. Apologies if the crosspost is unwelcome.) strchr() is to strrchr() as strstr() is to strrstr(), but strrstr() isn't part of the standard. Why not? -- Christopher Benson-Manica | I *should* know what I'm talking about - if I ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
2
2916
by: Derrick | last post by:
I've been working on an application which has a NotifyIcon (system tray icon), and a corresponding ContextMenu. I want to be able to update this menu dynamically. However, when I make changes to the menu, it seems to disappear. This only breaks when the context menu is tied to a NotifyIcon - not to any other control. Below is a C# file for a form which should illustrate this (at least it does on my machine!). The same contextmenu is...
2
3918
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 shows bytes sent & received. Anyone know how to pull this off? Thanks!
5
399
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 my mouse. If I don't hover over it to make it disappear and then open the program again, another one is added, resulting in a multiplicity of the icon in the tray. I've even tried setting its Visible property to false, followed by a call to the...
2
2227
by: ForrestPhoto | last post by:
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...
2
5779
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 and put my icon dispose call in there, but when process.kill() is called from an outside app on the notifyicon app, the event doesn't get raised. the app closes but the icon remains in the tray as dispose was never called. any ideas? another...
8
8485
by: starrysky | last post by:
I have a program which puts an icon in the notification area and has a menu associated with it available by right clicking on the icon. I want the menu items to be selected by single left clicks but I also want the user to be able to single left click on the icon itself to do some other functionality. Here's the problem - the single click on the menu first fires the notifyicon1_click() routine and then the menuitem1_click() routine. How do I...
0
8425
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8845
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8622
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7355
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6177
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5647
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4333
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2745
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.