VisualStyleElement.TrackBar.Track Třída

Definice

VisualStyleElement Poskytuje pro trasu vodorovný pruh stopy. Tato třída se nemůže dědit.

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

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 DrawVisualStyleElementTrackBarTrack1Paint z metody zpracování událostí a předejte e ji jako PaintEventArgs.

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

Vlastnost NormalVisualStyleElement.TrackBar.Track třídy vrátí VisualStyleElement trasu, která představuje trasu pro vodorovnou čáru dráhy.

Vlastnosti

Normal

Získá vizuální styl prvek, který představuje stopu pro vodorovný pruh stopy.

Platí pro

Viz také