Compartir a través de


SimpleShape.BackStyle (Propiedad)

Obtiene o establece la transparencia de la forma.

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

Sintaxis

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

Valor de propiedad

Tipo: Microsoft.VisualBasic.PowerPacks.BackStyle
Uno de los valores de BackStyle (Opaque o Transparent).De manera predeterminada, es Transparent.

Comentarios

Cuando el BackStyle propiedad está establecida en Transparent (valor predeterminado), el BackColor propiedad no tiene ningún efecto.

Establecer el BackgroundImage o FillStyle propiedad reemplaza la configuración de BackStyle.

Ejemplos

En el ejemplo siguiente se muestra cómo utilizar el BackStyle propiedad para alternar entre una forma opaca y transparente. Este ejemplo requiere que haya un OvalShape control denominado OvalShape1 en un formulario.

Private Sub OvalShape1_Click() Handles OvalShape1.Click
    ' Change between transparent and opaque. 
    If OvalShape1.BackStyle = PowerPacks.BackStyle.Transparent Then
        OvalShape1.BackStyle = PowerPacks.BackStyle.Opaque
        OvalShape1.BackColor = Color.LimeGreen
    Else
        OvalShape1.BackStyle = PowerPacks.BackStyle.Transparent
    End If 
End Sub
private void ovalShape1_Click(System.Object sender, System.EventArgs e)
{
    // Change between transparent and opaque. 
    if (ovalShape1.BackStyle == BackStyle.Transparent)
    {
        ovalShape1.BackStyle = BackStyle.Opaque;
        ovalShape1.BackColor = Color.LimeGreen;
    }
    else
    {
        ovalShape1.BackStyle = BackStyle.Transparent;
    }
}

Seguridad de .NET Framework

Vea también

Referencia

SimpleShape Clase

Microsoft.VisualBasic.PowerPacks (Espacio de nombres)

Otros recursos

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

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

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