共用方式為


SimpleShape.FillGradientStyle 屬性

取得或設定用於填滿圖形的漸層樣式。

命名空間:  Microsoft.VisualBasic.PowerPacks
組件:  Microsoft.VisualBasic.PowerPacks.Vs (在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)

語法

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

屬性值

類型:Microsoft.VisualBasic.PowerPacks.FillGradientStyle
AFillGradientStyle決定類型和漸層填滿圖形上顯示的方向的列舉型別。

備註

如果FillStyle以外屬性設定為任何值Solid,將不會顯示漸層效果。

當FillGradientStyle設為None,這個屬性沒有任何作用。

當FillGradientStyle設為Central,將由決定圖形中央的色彩FillGradientColor。 此色彩會逐漸融入FillColor外部邊緣。

當FillGradientStyle設為HorizontalForwardDiagonal,色彩會從混合FillColor左邊FillGradientColor右邊。

當FillGradientStyle設為BackwardDiagonal,色彩會從混合FillGradientColor左邊FillColor右邊。

當FillGradientStyle設為Vertical,色彩會從混合FillColor頂端上FillGradientColor底部。

範例

下列範例示範如何使用FillGradientStyle屬性來變更圖形的外觀。 此範例中您需要OvalShape名 OvalShape1 為表單上的控制項。

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 安全性

請參閱

參考

SimpleShape 類別

Microsoft.VisualBasic.PowerPacks 命名空間

其他資源

Line 和 Shape 控制項簡介 (Visual Studio)

如何:使用 LineShape 控制項繪製線條 (Visual Studio)

如何:使用 OvalShape 和 RectangleShape 控制項繪製圖案 (Visual Studio)