This documentation is archived and is not being maintained.

SimpleShape.FillGradientStyle Property

Gets or sets the gradient style that is used to fill the shape.

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

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

Property Value

Type: Microsoft.VisualBasic.PowerPacks.FillGradientStyle

A FillGradientStyle enumeration that determines the type and direction of a gradient fill displayed on the shape.

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

When the 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 the 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 FillGradientStyle 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(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

Show: