473,385 Members | 1,829 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,385 software developers and data experts.

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 7340
Does it do this on all machines?

-smith

"Phil Galey" <pa*****@starcalif.com.nospam> wrote in message
news:eY**************@TK2MSFTNGP12.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*****@starcalif.com.nospam> wrote in message
news:eY**************@TK2MSFTNGP12.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********@pacbell.net> wrote in message
news:1E*******************@newssvr14.news.prodigy. com...
Simply explicitly remove the tray icon in the form closing event.
"Phil Galey" <pa*****@starcalif.com.nospam> wrote in message
news:eY**************@TK2MSFTNGP12.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.ComponentModel.CancelEventArgs)

YourTrayIcon.Visible = False

YourTrayIcon.dispose 'propably don't need this.

End Sub

"Phil Galey" <pa*****@starcalif.com.nospam> wrote in message
news:Ox**************@TK2MSFTNGP12.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********@pacbell.net> wrote in message
news:1E*******************@newssvr14.news.prodigy. com...
Simply explicitly remove the tray icon in the form closing event.
"Phil Galey" <pa*****@starcalif.com.nospam> wrote in message
news:eY**************@TK2MSFTNGP12.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.Visible = 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********@pacbell.net> wrote in message
news:C_*******************@newssvr14.news.prodigy. com...
VB.Net:

Protected Overrides Sub OnClosing(ByVal e As
System.ComponentModel.CancelEventArgs)

YourTrayIcon.Visible = False

YourTrayIcon.dispose 'propably don't need this.

End Sub

"Phil Galey" <pa*****@starcalif.com.nospam> wrote in message
news:Ox**************@TK2MSFTNGP12.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********@pacbell.net> wrote in message
news:1E*******************@newssvr14.news.prodigy. com...
Simply explicitly remove the tray icon in the form closing event.
"Phil Galey" <pa*****@starcalif.com.nospam> wrote in message
news:eY**************@TK2MSFTNGP12.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
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...
149
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? --...
2
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...
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...
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...
2
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...
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...
8
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...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
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...

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.