NotifyIcon.BalloonTipText 属性

定义

获取或设置要在与 NotifyIcon 相关联的气球状提示上显示的文本。

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

属性值

要在与 NotifyIcon 相关联的气球状提示上显示的文本。

示例

下面的代码示例演示如何使用 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

适用于