共用方式為


NotifyIcon.BalloonTipIcon 屬性

定義

取得或設定與 NotifyIcon 相關聯之氣球提示上顯示的圖示。

public:
 property System::Windows::Forms::ToolTipIcon BalloonTipIcon { System::Windows::Forms::ToolTipIcon get(); void set(System::Windows::Forms::ToolTipIcon value); };
public System.Windows.Forms.ToolTipIcon BalloonTipIcon { get; set; }
member this.BalloonTipIcon : System.Windows.Forms.ToolTipIcon with get, set
Public Property BalloonTipIcon As ToolTipIcon

屬性值

要顯示在與 NotifyIcon 相關聯之氣球提示上顯示的 ToolTipIcon

例外狀況

範例

下列程式碼範例示範如何使用 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

適用於