VisualStyleElement.ScrollBar.SizeBox Classe
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Fornece VisualStyleElement objetos para cada estado do identificador 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 seguir demonstra como criar um VisualStyleRenderer com o VisualStyleElement retornado pela RightAlign propriedade. Para executar este exemplo, cole-o em um Formulário do Windows. Manipule o evento do Paint formulário e chame o DrawVisualStyleElementScrollBarSizeBox1 método do Paint método de tratamento 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 identificador de dimensionamento de uma barra de rolagem.
Propriedades
| Nome | Description |
|---|---|
| LeftAlign |
Obtém um elemento de estilo visual que representa um identificador de dimensionamento alinhado à esquerda. |
| RightAlign |
Obtém um elemento de estilo visual que representa um identificador de dimensionamento alinhado à direita. |