共用方式為


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

範例

以下程式碼範例示範如何用屬性VisualStyleElement回傳Hot的 來建立 aVisualStyleRenderer。 要執行這個範例,請將它貼到 Windows 表單中。 處理表單的Paint事件,並從DrawVisualStyleElementToolTipClose2事件處理方法呼叫該Paint方法,傳遞ePaintEventArgs

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每個屬性在工具提示的關閉按鈕狀態下都會有 aVisualStyleElement

屬性

名稱 Description
Hot

會獲得一個視覺風格元素,代表在熱狀態下的工具提示 關閉 按鈕。

Normal

會獲得一個視覺風格元素,代表工具提示 關閉 按鈕的正常狀態。

Pressed

會獲得一個視覺風格元素,代表按下狀態下的「 工具提示關閉 」按鈕。

適用於

另請參閱