Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SimpleShape.FillColor Property

Gets or sets the color that is used to fill the shape.

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

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

Property Value

Type: Color
The Color that is used to fill the shape.

The FillColor property has no effect when the FillStyle is set to Transparent. If both the BackColor and FillColor are set and FillStyle is set to Solid, FillColor overrides BackColor.

For all FillStyle enumerations except for Solid and Transparent, FillColor is used as the color for the pattern and BackColor is used as the background color.

The following example shows how to use the FillColor 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:
© 2015 Microsoft