Share via


VisualStyleElement.ToolTip.Balloon 類別

定義

針對汽球工具提示提供 VisualStyleElement 物件。 此類別無法獲得繼承。

public: ref class VisualStyleElement::ToolTip::Balloon abstract sealed
public static class VisualStyleElement.ToolTip.Balloon
type VisualStyleElement.ToolTip.Balloon = class
Public Class VisualStyleElement.ToolTip.Balloon
繼承
VisualStyleElement.ToolTip.Balloon

範例

下列程式碼範例示範如何使用 屬性所傳回的 Link 建立 VisualStyleElementVisualStyleRenderer 。 若要執行此範例,請將它貼到 Windows Form 中。 處理表單的事件 Paint ,並從事件處理方法呼叫 DrawVisualStyleElementToolTipBalloon2 方法 Paint ,並 e 傳遞為 PaintEventArgs

public void DrawVisualStyleElementToolTipBalloon2(PaintEventArgs e)
{
    if (VisualStyleRenderer.IsElementDefined(
        VisualStyleElement.ToolTip.Balloon.Link))
    {
        VisualStyleRenderer renderer =
             new VisualStyleRenderer(VisualStyleElement.ToolTip.Balloon.Link);
        Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
        renderer.DrawBackground(e.Graphics, rectangle1);
        e.Graphics.DrawString("VisualStyleElement.ToolTip.Balloon.Link",
             this.Font, Brushes.Black, new Point(10, 10));
    }
    else
        e.Graphics.DrawString("This element is not defined in the current visual style.",
             this.Font, Brushes.Black, new Point(10, 10));
}
Public Sub DrawVisualStyleElementToolTipBalloon2(ByVal e As PaintEventArgs)
    If (VisualStyleRenderer.IsElementDefined( _
     VisualStyleElement.ToolTip.Balloon.Link)) Then
        Dim renderer As New VisualStyleRenderer _
          (VisualStyleElement.ToolTip.Balloon.Link)
        Dim rectangle1 As New Rectangle(10, 50, 50, 50)
        renderer.DrawBackground(e.Graphics, rectangle1)
        e.Graphics.DrawString("VisualStyleElement.ToolTip.Balloon.Link", _
          Me.Font, Brushes.Black, New Point(10, 10))
    Else
        e.Graphics.DrawString("This element is not defined in the current visual style.", _
          Me.Font, Brushes.Black, New Point(10, 10))
    End If
End Sub

備註

類別的每個屬性 VisualStyleElement.ToolTip.Balloon 都會 VisualStyleElement 針對批註方塊工具提示傳回 。

屬性

Link

取得視覺化樣式項目,表示包含連結的汽球工具提示。

Normal

取得視覺化樣式項目,表示包含文字的汽球工具提示。

適用於

另請參閱