By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,738 Members | 1,646 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,738 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.