FillGradientColor Property

SimpleShape.FillGradientColor Property

 

Gets or sets the gradient 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 FillGradientColor { get; set; }

Property Value

Type: System.Drawing.Color

The Color that is used for a gradient fill.

If the FillStyle property is set to any value other than Solid, the gradient effect will not be displayed.

When FillGradientStyle is set to None, this property has no effect.

When FillGradientStyle is set to Central, the color at the center of the shape will be determined by FillGradientColor. This color will gradually blend into the FillColor at the outer edges.

When FillGradientStyle is set to Horizontal or ForwardDiagonal, colors are blended from the FillColor on the left to the FillGradientColor on the right.

When FillGradientStyle is set to BackwardDiagonal, colors are blended from the FillGradientColor on the left to the FillColor on the right.

When FillGradientStyle is set to Vertical, colors are blended from the FillColor on the top to the FillGradientColor on the bottom.

The following example shows how to use the FillGradientColor 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;
}
Return to top
Show:
© 2016 Microsoft