Solved

NotifyIcon not disappearing after timeout

Posted on 2007-11-14
3
3,268 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now