VisualStyleElement.ScrollBar.SizeBox Classe

Definição

Fornece objetos VisualStyleElement para cada estado da alça de dimensionamento de uma barra de rolagem. Essa classe não pode ser herdada.

public: ref class VisualStyleElement::ScrollBar::SizeBox abstract sealed
public static class VisualStyleElement.ScrollBar.SizeBox
type VisualStyleElement.ScrollBar.SizeBox = class
Public Class VisualStyleElement.ScrollBar.SizeBox
Herança
VisualStyleElement.ScrollBar.SizeBox

Exemplos

O exemplo de código a RightAlign seguir demonstra como criar um VisualStyleRenderer com o VisualStyleElement retornado pela propriedade . Para executar este exemplo, cole-o em um Windows Form. Manipule o evento do Paint formulário e chame o DrawVisualStyleElementScrollBarSizeBox1 método do Paint método de manipulação de eventos, passando e como 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

Comentários

Cada propriedade da VisualStyleElement.ScrollBar.SizeBox classe retorna um VisualStyleElement para o identificador de dimensionamento de uma barra de rolagem.

Propriedades

LeftAlign

Obtém um elemento de estilo visual que representa uma alça de dimensionamento alinhada à esquerda.

RightAlign

Obtém um elemento de estilo visual que representa uma alça de dimensionamento alinhada à direita.

Aplica-se a

Confira também