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

NotifyIcon, Double-click doesn't do what it should (BUG?)

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.

Heres what DOES happen:

When I double-click, I get squat by default. So I wire up some code to
handle the DoubleClick event from the NotifyIcon. It executes the same code
as clicking the default menu item (which turns the NotifyIcon to invisible).
My opinion is that I shouldn't have to do this.

But wait, there's more! Here's where it gets buggy.

Not only did I have to manually wire up the code to perform the default, but
now since the NotifyIcon disappears on double-click, The message is still
pased to windows!!!! Meaning that after my NotifyIcon disappears, the NEXT
icon in the system tray catches the message and shows ITS context menu.
Arrrgh!!! :S

Does anyone have a quick way to avoid this? Can I halt the message somehow?
Do I need to write my own version which would include bubble support?
--

Any help is appreciated.
Thanks in advance.

WALDO
Nov 22 '05 #1
2 2662
Can you post the code?
"Rob Mayo" <NO****@NOSPAM.com> wrote in message
news:OA**************@TK2MSFTNGP11.phx.gbl...
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.

Heres what DOES happen:

When I double-click, I get squat by default. So I wire up some code to
handle the DoubleClick event from the NotifyIcon. It executes the same
code
as clicking the default menu item (which turns the NotifyIcon to
invisible).
My opinion is that I shouldn't have to do this.

But wait, there's more! Here's where it gets buggy.

Not only did I have to manually wire up the code to perform the default,
but
now since the NotifyIcon disappears on double-click, The message is still
pased to windows!!!! Meaning that after my NotifyIcon disappears, the NEXT
icon in the system tray catches the message and shows ITS context menu.
Arrrgh!!! :S

Does anyone have a quick way to avoid this? Can I halt the message
somehow?
Do I need to write my own version which would include bubble support?
--

Any help is appreciated.
Thanks in advance.

WALDO

Nov 22 '05 #2
Something I've noticed since. Outlook 2003 has consistently been the closest
Tray Icon to my app. I happened to try this when outlook wasn't running and
the buggy behavior didn't reproduce. I opened Outlook again and there it was
again. Weird, huh?

---------------------------

Private Sub mnuShow_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles mnuShow.Click
Me.Show()
End Sub

Public Shadows Sub Hide()
If Me.ShowInTaskbar = True Then Me.ShowInTaskbar = False
Me.NotifyIcon1.Visible = True
MyBase.Hide()
End Sub

Public Shadows Sub Show()
If Me.ShowInTaskbar = False Then Me.ShowInTaskbar = True
MyBase.Show()
Me.Activate()
Me.NotifyIcon1.Visible = False
End Sub

Private Sub NotifyIcon1_DoubleClick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles NotifyIcon1.DoubleClick
Me.Show()
End Sub

--

Any help is appreciated.
Thanks in advance.

WALDO
"W.G. Ryan eMVP" <Wi*********@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Can you post the code?
"Rob Mayo" <NO****@NOSPAM.com> wrote in message
news:OA**************@TK2MSFTNGP11.phx.gbl...
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.

Heres what DOES happen:

When I double-click, I get squat by default. So I wire up some code to
handle the DoubleClick event from the NotifyIcon. It executes the same
code
as clicking the default menu item (which turns the NotifyIcon to
invisible).
My opinion is that I shouldn't have to do this.

But wait, there's more! Here's where it gets buggy.

Not only did I have to manually wire up the code to perform the default,
but
now since the NotifyIcon disappears on double-click, The message is still pased to windows!!!! Meaning that after my NotifyIcon disappears, the NEXT icon in the system tray catches the message and shows ITS context menu.
Arrrgh!!! :S

Does anyone have a quick way to avoid this? Can I halt the message
somehow?
Do I need to write my own version which would include bubble support?
--

Any help is appreciated.
Thanks in advance.

WALDO


Nov 22 '05 #3

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

Similar topics

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...
6
by: Brian Smith | last post by:
Is there a way to avoid the default action of TreeNode expansion/contraction caused by double click? I can add an event handler to pop up my properties dialog on double click, but it has the...
1
by: Alex K. | last post by:
I am using combo box with DropDownStyle = simple. Tried to use double click event but it does not work. I've got this.comboItems.DoubleClick += new...
4
by: perspolis | last post by:
hi I manage a double click event in a combo box.. but this event doesn't fire ???? I don't know why??
2
by: Alpha | last post by:
I have a window application. In one of the form, a datagrid has a dataview as its datasource. Initial filtering result would give the datavew 3 items. When I double click on the datagrid to edit...
2
by: Heather R | last post by:
I am writing a windows service that has a notifyicon component. The component displays accordingly, but for some reason, I cannot get the click or double click event to fire. It seems like none of...
3
by: Neil Wallace | last post by:
Hi, This is an odd one. I've been struggling to get "double click" to work well for my controls. The same event handler works perfectly for buttons, but not for labels. Can anyone tell me...
3
by: Siv | last post by:
Hi, I have a ListView control in a Windows application, currently single clicking a customer name in this list, selects the customer and displays their details in text boxes to the right of the...
5
by: David Veeneman | last post by:
I'm trying to implement some fairly standard behavior (or so I thought) on a FolderBrowserDialog component. double-clicking a folder in the dialog should have the same effect as selecting the...
1
by: \Ji Zhou [MSFT]\ | last post by:
Hello Jason, Thanks for using Microsoft Newsgroup Support Service, my name is Ji Zhou and I will be working on this issue with you. I have tried to but cannot reproduce your issue on my side....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.