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)

Syntax

'Declaration
<BrowsableAttribute(True)> _
Public Property FillStyle As FillStyle
[BrowsableAttribute(true)]
public FillStyle FillStyle { get; set; }
[BrowsableAttribute(true)]
public:
property FillStyle FillStyle {
    FillStyle get ();
    void set (FillStyle value);
}
[<BrowsableAttribute(true)>]
member FillStyle : FillStyle with get, set
function get FillStyle () : FillStyle 
function set FillStyle (value : FillStyle)

Property Value

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

Remarks

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.

Examples

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 Sub OvalShape1_Click() 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;
}

.NET Framework Security

See Also

Reference

SimpleShape Class

Microsoft.VisualBasic.PowerPacks Namespace

Other Resources

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)