NotifyIcon.BalloonTipTitle 属性

定义

获取或设置在 NotifyIcon 上显示的气球状提示的标题。

public:
 property System::String ^ BalloonTipTitle { System::String ^ get(); void set(System::String ^ value); };
public string BalloonTipTitle { get; set; }
member this.BalloonTipTitle : string with get, set
Public Property BalloonTipTitle As String

属性值

要作为气球状提示的标题显示的文本。

示例

下面的代码示例演示如何使用 BalloonTipTitleBalloonTipTextBalloonTipIcon 属性。 若要运行此示例,请将示例代码粘贴到包含 NotifyIcon 名为 notifyIcon1的 Windows 窗体中。 从窗体的构造函数或Load事件处理方法调用 SetBalloonTip

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(30000);
}
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(30000)

End Sub

注解

标题文本将以加粗字体显示在气球顶部附近。

适用于