Export (0) Print
Expand All

SimpleShape.FillStyle Property

Gets or sets the pattern used to fill the shape.

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

[BrowsableAttribute(true)]
public FillStyle FillStyle { get; set; }

Property Value

Type: Microsoft.VisualBasic.PowerPacks.FillStyle
A FillStyle enumeration that determines the pattern to be displayed in the shape.

The FillStyle property can be used to display a solid color or a two-color pattern on a shape.

When the FillStyle property is set to Solid, the FillColor is used to fill the shape. For all other patterns, the FillColor is used for the pattern and the BackColor is used for the background.

When the FillStyle property is set to any value other than Solid, the FillGradientColor and FillGradientStyle properties have no effect.

The following example shows how to use the FillStyle property to change the appearance of a 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)
{
    // 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;
}

Show:
© 2014 Microsoft