NotifyIcon is .NET’s version of the system tray icon, those little icons that appear next to the clock in the Windows Start bar. .NET 2.0 added the ability to display a pop-up balloon tip pointing at a tray icon. However, this capability doesn’t always work as you would expect.
The NotifyIcon.ShowBalloonTip method has the following signature:
- ShowBalloonTip(Int32) – Displays a balloon tip in the system tray for the specified time period (in milliseconds).
- ShowBalloonTip(Int32, String, String, ToolTipIcon) – Displays a balloon tip with the specified title, text, and icon in the system tray for the specified time period.
Issue #1: Timeout Limits
The NotifyIcon’s balloon tip will appear for a minimum of 10 seconds and maximum of 30 seconds, though this can vary by operating system. Timeout values that are too small or too large will be forced into this range.
Issue #2: Requires User Activity
If the user is not using the computer (no keyboard or mouse events are occurring) then the system does not count this time towards the timeout, and the balloon tip could appear indefinitely. The logic is that users should not miss notifications when they are away from their computer.
Issue #3: One Balloon at a Time
Only one balloon tip can appear on the system tray at one time. If an application attempts to display a second balloon tip, the first balloon is closed immediately (regardless of the timeout setting) and the second balloon appears. However, if the first balloon was displayed by another application, it won’t close until its timeout expires, at which point the second balloon will appear.
Issue #4: Balloon Never Closes
If an application exits without explicitly setting the NotifyIcon.Visible property to false, the icon remains in the system tray (though it disappears when the user moves the mouse over the icon). And if a balloon tip was showing for that icon, the balloon will remain visible even after the application has exited.
Tip: To Close Balloons
To explicitly close a balloon at any time, simply set the NotifyIcon.Visible property to false, then immediately back to true.
really useful information, thanks for posting it!
thanks for tip #1 that was vexing me…
Very good tips. Helped to fix my issue
Thanks
Thanks brother, for such nice tips.
Tip: To Close Balloons really helped me .
keep good work.
The maximal length for the BallontipText is 255 characters. This is sometimes really impractical.
Sorry to grave dig this old article however there are some noteworthy aspects worth mentioning.
The best way is to call the Dispose() method from the NotifyIcon instance and then set that instance to null. Changing the Visible attribute works however this is not its intended purpose.
Also the Text property is limited to 64 characters.
The Ballontip also isn’t displayed if you don’t have defined a DoubleClick Method for the NI
HI!
Do you Know. Why do the ballon tips appears in different time.
For example… run my application and the ballontip that tell that the application starts, aperar after 15 min, before I run again and apperar after 5 min.
why?
Thank’s in advance
hi!
please provide the details about the showballoontip using c#.net
Very very thanks bro 😀 It’s solved my problem.
But I got a question:
How can I disable the timeout?
I ask this becouse sometimes the balloontip closes down in a short time. For Ex:
Private sub Button1_click
NotifyIcon1.ShowBalloonTip(3000)
End Sub
Private Sub Timer8_Tick
Label18.Text = Label18.Text + 1
If Label18.Text = 5 Then
NotifyIcon1.Visible = False
NotifyIcon1.Visible = True
End If
End Sub
I made commands like this. I’ve done balloontip to be closed in 5 seconds. But it’s sometimes closes down in
3 or 4 seconds. How could I solve it?
Does not work!!! Notify icon still remains. Have to manually hover mouse over the notification area to remove it.
thanks and helpful
[…] NotifyIcon.ShowBalloonTip Issues […]