Partager via


SimpleShape.FillStyle, propriété

Mise à jour : novembre 2007

Obtient ou définit le motif utilisé pour remplir la forme.

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

Syntaxe

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

Dim instance As SimpleShape
Dim value As FillStyle

value = instance.FillStyle

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

Valeur de propriété

Type : Microsoft.VisualBasic.PowerPacks.FillStyle

Énumération FillStyle qui détermine le motif à afficher dans la forme.

Notes

La propriété FillStyle peut être utilisée pour afficher une couleur unie ou un motif bicolore sur une forme.

Lorsque la propriété FillStyle a la valeur Solid, FillColor est utilisé pour remplir la forme. Pour tous les autres modèles, FillColor est utilisé pour le motif et BackColor pour l'arrière-plan.

Lorsque la propriété FillStyle a une valeur autre que Solid, les propriétés FillGradientColor et FillGradientStyle n'ont aucun effet.

Exemples

L'exemple suivant montre comment utiliser la propriété FillStyle pour modifier l'apparence d'une forme. 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
    ' Set the fill style.
    OvalShape1.FillStyle = FillStyle.Solid
    ' Set the fill color.
    OvalShape1.FillColor = Color.Red
    ' Set the gradient style.
    OvalShape1.FillGradientStyle = FillGradientStyle.Central
    ' Set the gradient color.
    OvalShape1.FillGradientColor = Color.Purple
End Sub
private void ovalShape1_Click(System.Object sender, System.EventArgs e)
{
    // Set the fill style.
    ovalShape1.FillStyle = FillStyle.Solid;
    // Set the fill color.
    ovalShape1.FillColor = Color.Red;
    // Set the gradient style.
    ovalShape1.FillGradientStyle = FillGradientStyle.Central;
    // Set the gradient color.
    ovalShape1.FillGradientColor = Color.Purple;
}

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)