共用方式為


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 Form 中。 從表單的建構函式或 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

適用於