Sdílet prostřednictvím


VisualStyleElement.ScrollBar.ThumbButtonHorizontal Třída

Definice

Poskytuje VisualStyleElement objekty pro každý stav vodorovného posuvníku (označuje se také jako palec). Tato třída se nemůže dědit.

public: ref class VisualStyleElement::ScrollBar::ThumbButtonHorizontal abstract sealed
public static class VisualStyleElement.ScrollBar.ThumbButtonHorizontal
type VisualStyleElement.ScrollBar.ThumbButtonHorizontal = class
Public Class VisualStyleElement.ScrollBar.ThumbButtonHorizontal
Dědičnost
VisualStyleElement.ScrollBar.ThumbButtonHorizontal

Příklady

Následující příklad kódu ukazuje, jak vytvořit VisualStyleRenderer s VisualStyleElement vrácenou Normal vlastností . Pokud chcete spustit tento příklad, vložte ho do formuláře Windows Form. Zpracujte Paint událost formuláře a zavolejte metodu DrawVisualStyleElementScrollBarThumbButtonHorizontal1Paint z metody zpracování událostí a předejte e ji jako PaintEventArgs.

public void DrawVisualStyleElementScrollBarThumbButtonHorizontal1(PaintEventArgs e)
{
    if (VisualStyleRenderer.IsElementDefined(
        VisualStyleElement.ScrollBar.ThumbButtonHorizontal.Normal))
    {
        VisualStyleRenderer renderer =
             new VisualStyleRenderer(VisualStyleElement.ScrollBar.ThumbButtonHorizontal.Normal);
        Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
        renderer.DrawBackground(e.Graphics, rectangle1);
        e.Graphics.DrawString("VisualStyleElement.ScrollBar.ThumbButtonHorizontal.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 DrawVisualStyleElementScrollBarThumbButtonHorizontal1(ByVal e As PaintEventArgs)
    If (VisualStyleRenderer.IsElementDefined( _
     VisualStyleElement.ScrollBar.ThumbButtonHorizontal.Normal)) Then
        Dim renderer As New VisualStyleRenderer _
          (VisualStyleElement.ScrollBar.ThumbButtonHorizontal.Normal)
        Dim rectangle1 As New Rectangle(10, 50, 50, 50)
        renderer.DrawBackground(e.Graphics, rectangle1)
        e.Graphics.DrawString("VisualStyleElement.ScrollBar.ThumbButtonHorizontal.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

Poznámky

Každá vlastnost VisualStyleElement.ScrollBar.ThumbButtonHorizontal třídy vrátí VisualStyleElement pro jiný stav vodorovného posuvníku.

Vlastnosti

Name Description
Disabled

Získá prvek vizuálního stylu, který představuje vodorovný posuvník v zakázaném stavu.

Hot

Získá vizuální styl prvek, který představuje vodorovné posuvník pole v horkém stavu.

Normal

Získá prvek vizuálního stylu, který představuje vodorovné posuvné pole v normálním stavu.

Pressed

Získá vizuální styl prvek, který představuje vodorovné posuvné pole ve stisknutém stavu.

Platí pro

Viz také