VisualStyleElement.ToolTip.Close 類別

定義

針對工具提示之 [關閉] 按鈕的每個狀態提供 VisualStyleElement 物件。 此類別無法獲得繼承。

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

範例

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

public void DrawVisualStyleElementToolTipClose2(PaintEventArgs e)
{
    if (VisualStyleRenderer.IsElementDefined(
        VisualStyleElement.ToolTip.Close.Hot))
    {
        VisualStyleRenderer renderer =
             new VisualStyleRenderer(VisualStyleElement.ToolTip.Close.Hot);
        Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
        renderer.DrawBackground(e.Graphics, rectangle1);
        e.Graphics.DrawString("VisualStyleElement.ToolTip.Close.Hot",
             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 DrawVisualStyleElementToolTipClose2(ByVal e As PaintEventArgs)
    If (VisualStyleRenderer.IsElementDefined( _
     VisualStyleElement.ToolTip.Close.Hot)) Then
        Dim renderer As New VisualStyleRenderer _
          (VisualStyleElement.ToolTip.Close.Hot)
        Dim rectangle1 As New Rectangle(10, 50, 50, 50)
        renderer.DrawBackground(e.Graphics, rectangle1)
        e.Graphics.DrawString("VisualStyleElement.ToolTip.Close.Hot", _
          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.Close 都會取得 VisualStyleElement 工具提示之 [關閉 ] 按鈕之不同狀態的 。

屬性

Hot

取得視覺化樣式元素,表示處於作用中狀態的工具提示 [關閉] 按鈕。

Normal

取得視覺化樣式元素,表示處於正常狀態的工具提示 [關閉] 按鈕。

Pressed

取得視覺化樣式元素,表示處於按下狀態的工具提示 [關閉] 按鈕。

適用於

另請參閱