NotifyIcon.BalloonTipTitle 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置在 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
属性值
要作为气球状提示的标题显示的文本。
示例
下面的代码示例演示如何使用 BalloonTipTitle、 BalloonTipText和 BalloonTipIcon 属性。 若要运行此示例,请将示例代码粘贴到包含 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
注解
标题文本将以加粗字体显示在气球顶部附近。