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)
Syntax
[BrowsableAttribute(true)]
public BackStyle BackStyle { get; set; }
public:
[BrowsableAttribute(true)]
property BackStyle BackStyle {
BackStyle get();
void set(BackStyle value);
}
[<BrowsableAttribute(true)>]
member BackStyle : BackStyle with get, set
<BrowsableAttribute(True)>
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.
Remarks
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.
Examples
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;
}
else
{
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
Else
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