SimpleShape.BackStyle Property


Gets or sets the transparency of the shape.

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


public BackStyle BackStyle { get; set; }
property BackStyle BackStyle {
    BackStyle get();
    void set(BackStyle value);
member BackStyle : BackStyle with get, set
Public Property BackStyle As BackStyle

Property Value

Type: Microsoft.VisualBasic.PowerPacks.BackStyle

One of the values of BackStyle (Opaque or Transparent). The default is Transparent.


When the BackStyle property is set to Transparent (the default), the BackColor property has no effect.

Setting the BackgroundImage or FillStyle property overrides the setting of BackStyle.


The following example shows how to use the BackStyle property to switch back and forth between an opaque and transparent shape. This example requires that you have an OvalShape control named OvalShape1 on a form.

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;
        ovalShape1.BackStyle = BackStyle.Transparent;
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
        OvalShape1.BackStyle = PowerPacks.BackStyle.Transparent
    End If
End Sub

See Also

SimpleShape Class
Microsoft.VisualBasic.PowerPacks Namespace
Introduction to the Line and Shape Controls (Visual Studio)
How to: Draw Lines with the LineShape Control (Visual Studio)
How to: Draw Shapes with the OvalShape and RectangleShape Controls (Visual Studio)

Return to top