How do I stop a notify icon appearing multiple times... then disappear when mouse hovers over them RRS feed

  • Question

  • Hi,

    I have an Outlook addin which makes use of a System.Windows.Forms.NotifyIcon to display update message without requiring the user to click Okay to dismiss them...etc.

    I declare and create it in the addin class (so not in start up or any other event) as:

    Public WithEvents notifyIcon As New System.Windows.Forms.NotifyIcon

    Then throughout in my code if I need to display a message I use notifyIcon.ShowBalloonTip.  This works great, and I run it off the main thread as well as a syncing background worker thread.  The problem is that when I go down and expand the system tray, there are often many clones of the icon I use, which then disappear when I hover my mouse over them.

    I understand this isn't an uncommon problem, and it happens also with new email icons in the system tray.  However, is there any way I can prevent this from happening, or best practices I need to abide by?

    In the Shutdown event I use:

    If notifyIcon IsNot Nothing Then
      notifyIcon.Visible = False
    End If

    Any help would be much appreciated, since I can't seem to find any definitive info elsewhere online.



    Monday, March 23, 2015 10:46 AM


All replies