.NET Framework Class Library
NotifyIcon.ShowBalloonTip Method (Int32)

Note: This method is new in the .NET Framework version 2.0.

Displays a balloon tip in the taskbar for the specified time period.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

Syntax

Visual Basic (Declaration)
Public Sub ShowBalloonTip ( _
    timeout As Integer _
)
Visual Basic (Usage)
Dim instance As NotifyIcon
Dim timeout As Integer

instance.ShowBalloonTip(timeout)
C#
public void ShowBalloonTip (
    int timeout
)
C++
public:
void ShowBalloonTip (
    int timeout
)
J#
public void ShowBalloonTip (
    int timeout
)
JScript
public function ShowBalloonTip (
    timeout : int
)

Parameters

timeout

The time period, in milliseconds, the balloon tip should display.

Remarks

Minimum and maximum timeout values are enforced by the operating system and are typically 10 and 30 seconds, respectively, however this can vary depending on the operating system. Timeout values that are too large or too small are adjusted to the appropriate minimum or maximum value. In addition, if the user does not appear to be using the computer (no keyboard or mouse events are occurring) then the If the user does not appear to be using the computer, the system does not count this time towards the timeout.

Only one balloon tip can display on the taskbar at a time. Attempting to display a balloon tip when one is currently displayed on the taskbar causes the timeout value to be ignored. The behavior is slightly different depending on whether the balloon tip is from another, or the same, application. When the second balloon tip is from another application, the first balloon tip will display for the minimum timeout value before the second appears, regardless of the value of timeout. If the balloon tips are from the same application, the first balloon tip immediately closes when another call to the ShowBalloonTip method is made.

The title text will display in a bold font near the top of the balloon.

Example

The following code example demonstrates how to use the ShowBalloonTip method. To run this example, paste the example code into a Windows Form that contains a NotifyIcon named notifyIcon1. Call SetBalloonTip from the form's constructor or Load event-handling method.

Visual Basic
Private Sub SetBalloonTip()
    notifyIcon1.Icon = SystemIcons.Exclamation
    notifyIcon1.BalloonTipTitle = "Balloon Tip Title"
    notifyIcon1.BalloonTipText = "Balloon Tip Text."
    notifyIcon1.BalloonTipIcon = ToolTipIcon.Error

End Sub

Sub Form1_Click(ByVal sender As Object, ByVal e As EventArgs) _
    Handles Me.Click

    notifyIcon1.Visible = True
    notifyIcon1.ShowBalloonTip(30)

End Sub
C#
private void SetBalloonTip()
{
    notifyIcon1.Icon = SystemIcons.Exclamation;
    notifyIcon1.BalloonTipTitle = "Balloon Tip Title";
    notifyIcon1.BalloonTipText = "Balloon Tip Text.";
    notifyIcon1.BalloonTipIcon = ToolTipIcon.Error;
    this.Click += new EventHandler(Form1_Click);
}

void Form1_Click(object sender, EventArgs e) 
{
    notifyIcon1.Visible = true;
    notifyIcon1.ShowBalloonTip(30);

}
Platforms

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

Version Information

.NET Framework

Supported in: 2.0
See Also

Tags :


Community Content

Kapil Kathuria
BalloonTip of other applications
"The behavior is slightly different depending on whether the balloon tip is from another, or the same, application. When the second balloon tip is from another application, the first balloon tip will display for the minimum timeout value before the second appears, regardless of the value of timeout."

Is there no way to show ballontip of my application overriding ballontip which is being already shown by other application?
Tags : balloontip

Page view tracker