Solved

NotifyIcon not disappearing after timeout

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

910 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

22 Experts available now in Live!

Get 1:1 Help Now