VisualStyleElement.Window.VerticalThumb 類別

定義

根據視窗垂直捲動方塊 (英文為 Scroll Box 或 Thumb) 的每個狀態提供 VisualStyleElement 物件。 此類別無法獲得繼承。

public: ref class VisualStyleElement::Window::VerticalThumb abstract sealed
public static class VisualStyleElement.Window.VerticalThumb
type VisualStyleElement.Window.VerticalThumb = class
Public Class VisualStyleElement.Window.VerticalThumb
繼承
VisualStyleElement.Window.VerticalThumb

範例

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

public void DrawVisualStyleElementWindowVerticalThumb1(PaintEventArgs e)
{
    if (VisualStyleRenderer.IsElementDefined(
        VisualStyleElement.Window.VerticalThumb.Normal))
    {
        VisualStyleRenderer renderer =
             new VisualStyleRenderer(VisualStyleElement.Window.VerticalThumb.Normal);
        Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
        renderer.DrawBackground(e.Graphics, rectangle1);
        e.Graphics.DrawString("VisualStyleElement.Window.VerticalThumb.Normal",
             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 DrawVisualStyleElementWindowVerticalThumb1(ByVal e As PaintEventArgs)
    If (VisualStyleRenderer.IsElementDefined( _
     VisualStyleElement.Window.VerticalThumb.Normal)) Then
        Dim renderer As New VisualStyleRenderer _
          (VisualStyleElement.Window.VerticalThumb.Normal)
        Dim rectangle1 As New Rectangle(10, 50, 50, 50)
        renderer.DrawBackground(e.Graphics, rectangle1)
        e.Graphics.DrawString("VisualStyleElement.Window.VerticalThumb.Normal", _
          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.Window.VerticalThumb 的每個屬性都會 VisualStyleElement 針對視窗垂直捲動盒的不同狀態傳回 。

屬性

Disabled

取得視覺化樣式項目,表示處於停用狀態的垂直捲動方塊。

Hot

取得視覺化樣式項目,表示處於作用中狀態的垂直捲動方塊。

Normal

取得視覺化樣式項目,表示處於正常狀態的垂直捲動方塊。

Pressed

取得視覺化樣式項目,表示處於已按下狀態的垂直捲動方塊。

適用於

另請參閱