SimpleShape.FillColor 屬性
取得或設定用於填滿形狀的色彩。
命名空間: Microsoft.VisualBasic.PowerPacks
組件: Microsoft.VisualBasic.PowerPacks.Vs (在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)
語法
'宣告
<BrowsableAttribute(True)> _
Public Property FillColor As Color
[BrowsableAttribute(true)]
public Color FillColor { get; set; }
[BrowsableAttribute(true)]
public:
property Color FillColor {
Color get ();
void set (Color value);
}
[<BrowsableAttribute(true)>]
member FillColor : Color with get, set
function get FillColor () : Color
function set FillColor (value : Color)
屬性值
型別:System.Drawing.Color
Color ,用來填滿形狀。
備註
FillColor屬性沒有作用時FillStyle設定為 [ Transparent。If both the BackColor and FillColor are set and FillStyle is set to Solid, FillColor overrides BackColor.
所有FillStyle列舉型別除了Solid和Transparent, FillColor用來作為色彩模式和BackColor做為背景色彩。
範例
下列範例會示範如何使用FillColor屬性,以變更圖形的外觀。這個範例要求您必須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 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。
請參閱
參考
Microsoft.VisualBasic.PowerPacks 命名空間
其他資源
Line 和 Shape 控制項簡介 (Visual Studio)
HOW TO:使用 LineShape 控制項繪製線條 (Visual Studio)
HOW TO:使用 OvalShape 和 RectangleShape 控制項繪製圖案 (Visual Studio)