Share via


SimpleShape.BackStyle-Eigenschaft

Ruft die Transparenz der Form fest.

Namespace:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Syntax

'Declaration
<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)

Eigenschaftswert

Typ: Microsoft.VisualBasic.PowerPacks.BackStyle
Einer der Werte von BackStyle (Opaque oder Transparent).Der Standardwert ist Transparent.

Hinweise

Wenn die BackStyle-Eigenschaft auf Transparent (Standardeinstellung) festgelegt wird, hat die BackColor-Eigenschaft keine Auswirkungen.

Die BackgroundImage oder FillStyle Festlegen der Eigenschaft überschreibt die Einstellung von BackStyle.

Beispiele

Im folgenden Beispiel wird gezeigt, wie die BackStyle-Eigenschaft verwendet, um zwischen einer deckenden und transparente Form hin und her wechseln.Dieses Beispiel setzt voraus, dass Sie ein OvalShape-Steuerelement verfügen, das in einem Formular OvalShape1.

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;
    }
}

.NET Framework-Sicherheit

Siehe auch

Referenz

SimpleShape Klasse

Microsoft.VisualBasic.PowerPacks-Namespace

Weitere Ressourcen

Einführung in das Line-Steuerelement und das Shape-Steuerelement (Visual Studio)

Gewusst wie: Zeichnen von Linien mit dem LineShape-Steuerelement (Visual Studio)

Gewusst wie: Zeichnen von Formen mit dem OvalShape-Steuerelement und dem RectangleShape-Steuerelement (Visual Studio)