SimpleShape.BackStyle, propriété

Mise à jour : novembre 2007

Obtient ou définit la transparence de la forme.

Espace de noms :  Microsoft.VisualBasic.PowerPacks
Assembly :  Microsoft.VisualBasic.PowerPacks.Vs (dans Microsoft.VisualBasic.PowerPacks.Vs.dll)

Syntaxe

<BrowsableAttribute(True)> _
Public Property BackStyle As BackStyle

Dim instance As SimpleShape
Dim value As BackStyle

value = instance.BackStyle

instance.BackStyle = value
[BrowsableAttribute(true)]
public BackStyle BackStyle { get; set; }
[BrowsableAttribute(true)]
public:
property BackStyle BackStyle {
    BackStyle get ();
    void set (BackStyle value);
}
public function get BackStyle () : BackStyle
public function set BackStyle (value : BackStyle)

Valeur de propriété

Type : Microsoft.VisualBasic.PowerPacks.BackStyle

Une des valeurs de BackStyle (Opaque ou Transparent). La valeur par défaut est Transparent.

Notes

La propriété BackColor est sans effet lorsque la propriété BackStyle a la valeur Transparent (valeur par défaut).

La définition de la propriété BackgroundImage ou FillStyle substitue la définition de BackStyle.

Exemples

L'exemple suivant montre comment utiliser la propriété BackStyle pour basculer entre une forme opaque et transparente. Cet exemple suppose qu'il existe un contrôle OvalShape nommé OvalShape1 sur un formulaire.

Private Sub OvalShape1_Click(ByVal sender As System.Object, _
 ByVal e As System.EventArgs) 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;
    }
}

Autorisations

Voir aussi

Référence

SimpleShape, classe

Membres SimpleShape

Microsoft.VisualBasic.PowerPacks, espace de noms

Autres ressources

Introduction aux contrôles Line et Shape (Visual Studio)

Comment : dessiner des lignes avec le contrôle LineShape (Visual Studio)

Comment : dessiner des formes avec les contrôles OvalShape et RectangleShape (Visual Studio)