Solved

NotifyIcon not disappearing after timeout

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

735 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