共用方式為


SimpleShape.FillStyle 屬性

更新:2007 年 11 月

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

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

語法

<BrowsableAttribute(True)> _
Public Property FillStyle As FillStyle

Dim instance As SimpleShape
Dim value As FillStyle

value = instance.FillStyle

instance.FillStyle = value
[BrowsableAttribute(true)]
public FillStyle FillStyle { get; set; }
[BrowsableAttribute(true)]
public:
property FillStyle FillStyle {
    FillStyle get ();
    void set (FillStyle value);
}
public function get FillStyle () : FillStyle
public function set FillStyle (value : FillStyle)

屬性值

型別:Microsoft.VisualBasic.PowerPacks.FillStyle

FillStyle 列舉型別,決定形狀中所顯示的圖樣。

備註

FillStyle 屬性可以用來在形狀中顯示實色或圖樣。

當 FillStyle 屬性是設定為 Solid 時,FillColor 會用來填滿形狀。就所有其他圖樣來說,FillColor 是用於圖樣,而 BackColor 是用於背景。

當 FillStyle 屬性是設定為 Solid 以外的任何值時,FillGradientColorFillGradientStyle 屬性沒有作用。

範例

下列範例顯示如何使用 FillStyle 屬性變更圖案的外觀。這個範例要求您的表單必須有一個名為 OvalShape1 的 OvalShape 控制項。

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
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;
}

使用權限

請參閱

參考

SimpleShape 類別

SimpleShape 成員

Microsoft.VisualBasic.PowerPacks 命名空間

其他資源

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

HOW TO:使用 LineShape 控制項繪製線條 (Visual Studio)

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