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 属性。 若要运行此示例,请将示例代码粘贴到包含名为 notifyIcon1NotifyIcon 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

适用于