VisualStyleElement.ScrollBar.SizeBox Osztály

Definíció

Objektumokat biztosít VisualStyleElement a görgetősáv méretezési fogópontjának minden állapotához. Ez az osztály nem örökölhető.

public: ref class VisualStyleElement::ScrollBar::SizeBox abstract sealed
public static class VisualStyleElement.ScrollBar.SizeBox
type VisualStyleElement.ScrollBar.SizeBox = class
Public Class VisualStyleElement.ScrollBar.SizeBox
Öröklődés
VisualStyleElement.ScrollBar.SizeBox

Példák

Az alábbi példakód bemutatja, hogyan hozhat létre egy VisualStyleRenderer tulajdonság által visszaadott VisualStyleElement kóddalRightAlign. A példa futtatásához illessze be egy Windows űrlapba. Kezelje az űrlap eseményét Paint , és hívja meg a DrawVisualStyleElementScrollBarSizeBox1 metódust az Paint eseménykezelési metódusból, és e adja át a következőt PaintEventArgs: .

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

Megjegyzések

Az osztály minden tulajdonsága VisualStyleElement.ScrollBar.SizeBox egy görgetősáv méretezési fogópontjához ad vissza egy VisualStyleElement értéket.

Tulajdonságok

Name Description
LeftAlign

Beolvas egy vizuális stíluselemet, amely egy bal oldali méretezési fogópontot jelöl.

RightAlign

Lekéri a jobb oldali méretezési fogópontot jelképező vizuális stíluselemet.

A következőre érvényes:

Lásd még