共用方式為


SimpleShape.FillStyle 屬性

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

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

語法

'宣告
<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)

屬性值

類型:Microsoft.VisualBasic.PowerPacks.FillStyle
AFillStyle決定要顯示在 [圖形模式的列舉型別。

備註

FillStyle屬性可以用來在圖形上顯示純色或兩種色彩模式。

當FillStyle屬性設定為SolidFillColor用來填滿形狀。 所有其他模式,FillColor用的模式比對和BackColor用於背景。

當FillStyle以外屬性設定為任何值SolidFillGradientColorFillGradientStyle屬性沒有任何作用。

範例

下列範例示範如何使用FillStyle屬性來變更圖形的外觀。 此範例中您需要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)