更新: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 以外的任何值時,FillGradientColor 和 FillGradientStyle 屬性沒有作用。
範例
下列範例顯示如何使用 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;
}
使用權限
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。
請參閱
參考
Microsoft.VisualBasic.PowerPacks 命名空間
其他資源
Line 和 Shape 控制項簡介 (Visual Studio)
HOW TO:使用 LineShape 控制項繪製線條 (Visual Studio)
HOW TO:使用 OvalShape 和 RectangleShape 控制項繪製圖案 (Visual Studio)