Solved

NotifyIcon not disappearing after timeout

Posted on 2007-11-14
3
3,304 Views
Last Modified: 2013-11-26
Does anyone know why my Balloon is not disappearing after 5 seconds? Here is my code:

        With Me.NotifyIcon
            .Icon = Me.Icon
            .ShowBalloonTip(5000, "This is the title", "Program is running", ToolTipIcon.Info)
        End With

It does disappear if I click the close button or the bubble itself, but not after the timeout.
I've just started using VB2005.

Thanks.
0
Comment
Question by:JedNebula
3 Comments
 
LVL 48

Assisted Solution

by:jpaulino
jpaulino earned 25 total points
ID: 20279404
Hi JedNebula,

Don't know to well but the notifyicon doesn't work for me to. What i have made is to add an additional timer to do the hide. Somehting like this:

Private ToolTipTimer As New Timer
Private nf As NotifyIcon

Sub ToolTipTimerEnd(ByVal sender As System.Object, ByVal e As System.EventArgs)
        nf.Visible = False
        ToolTipTimer.Enabled = False
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

nf = New NotifyIcon
With nf
      .Icon = Me.Icon
      .Visible = True
      .ShowBalloonTip(5000, "This is the title", "Program is running", ToolTipIcon.Info)
End With

With ToolTipTimer
       .Interval = 5000
       .Enabled = True
End With
AddHandler ToolTipTimer.Tick, AddressOf ToolTipTimerEnd

End Sub
0
 
LVL 11

Accepted Solution

by:
TreyH earned 100 total points
ID: 20279439
0
 
LVL 4

Expert Comment

by:justin-clarke
ID: 26599695
@jpaulino nice code to get round this issue.

FYI I would add "nf.Visible = True" to your ToolTipTimerEnd Sub. Which will then stop the notify icon from disappearing, and I would stop the timer first.
Sub ToolTipTimerEnd(ByVal sender As System.Object, ByVal e As System.EventArgs)
        ToolTipTimer.Enabled = False
        nf.Visible = False
        nf.Visible = True
End Sub

Open in new window

0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question