Compartir a través de


Shape.BorderStyle (Propiedad)

Obtiene o establece el estilo del borde de un control de forma o línea.

Espacio de nombres:  Microsoft.VisualBasic.PowerPacks
Ensamblado:  Microsoft.VisualBasic.PowerPacks.Vs (en Microsoft.VisualBasic.PowerPacks.Vs.dll)

Sintaxis

'Declaración
<BrowsableAttribute(True)> _
Public Property BorderStyle As DashStyle
[BrowsableAttribute(true)]
public DashStyle BorderStyle { get; set; }
[BrowsableAttribute(true)]
public:
property DashStyle BorderStyle {
    DashStyle get ();
    void set (DashStyle value);
}
[<BrowsableAttribute(true)>]
member BorderStyle : DashStyle with get, set
function get BorderStyle () : DashStyle 
function set BorderStyle (value : DashStyle)

Valor de propiedad

Tipo: DashStyle
Valor de DashStyle que representa el aspecto del borde.El valor predeterminado es Solid.

Excepciones

Excepción Condición
InvalidEnumArgumentException

El valor especificado al establecer esta propiedad no es un valor válido de DashStyle.

Comentarios

Para una LineShape control BorderStyle representa el estilo de la línea.

Para un OvalShape o RectangleShape control BorderStyle representa el estilo de la propia forma cuando el BackStyle propiedad está establecida en Transparent. Cuando el BackStyle propiedad está establecida en Opaque, el BorderStyle representa el estilo de los bordes exteriores de la forma.

Ejemplos

En el ejemplo siguiente se muestra cómo establecer el BorderColor, BorderStyle, y BorderWidth las propiedades de un OvalShape control, que se muestra una elipse con un borde con puntos de 3 píxeles de ancho rojo.

Dim OvalShape1 As New OvalShape
Dim canvas As New ShapeContainer
' Set the form as the parent of the ShapeContainer.
canvas.Parent = Me 
' Set the ShapeContainer as the parent of the OvalShape.
OvalShape1.Parent = canvas
' Change the color of the border to red.
OvalShape1.BorderColor = Color.Red
' Change the style of the border to dotted.
OvalShape1.BorderStyle = Drawing2D.DashStyle.Dot
' Change the thickness of the border to 3 pixels.
OvalShape1.BorderWidth = 3
OvalShape1.Size = New Size(300, 200)
OvalShape ovalShape1 = new OvalShape();
ShapeContainer canvas = new ShapeContainer();
// Set the form as the parent of the ShapeContainer.
canvas.Parent = this;
// Set the ShapeContainer as the parent of the OvalShape.
ovalShape1.Parent = canvas;
// Change the color of the border to red.
ovalShape1.BorderColor = Color.Red;
// Change the style of the border to dotted.
ovalShape1.BorderStyle = System.Drawing.Drawing2D.DashStyle.Dot;
// Change the thickness of the border to 3 pixels.
ovalShape1.BorderWidth = 3;
ovalShape1.Size = new Size(300, 200);

Seguridad de .NET Framework

Vea también

Referencia

Shape Clase

Microsoft.VisualBasic.PowerPacks (Espacio de nombres)

Otros recursos

Cómo: Dibujar líneas con el control LineShape (Visual Studio)

Cómo: Dibujar formas con los controles OvalShape y RectangleShape (Visual Studio)

Introducción a los controles de líneas y formas (Visual Studio)