Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / General / August 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rob Mayo - 26 Aug 2005 17:12 GMT
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?
Signature


Any help is appreciated.
Thanks in advance.

WALDO

W.G. Ryan eMVP - 26 Aug 2005 23:46 GMT
Can you post the code?
> OK, maybe this is my opinion, maybe these are bugs.
>
[quoted text clipped - 28 lines]
> somehow?
> Do I need to write my own version which would include bubble support?
Rob Mayo - 30 Aug 2005 23:04 GMT
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

Signature

Any help is appreciated.
Thanks in advance.

WALDO

> Can you post the code?
> > OK, maybe this is my opinion, maybe these are bugs.
[quoted text clipped - 29 lines]
> > somehow?
> > Do I need to write my own version which would include bubble support?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.