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)

如何:使用 LineShape 控件绘制直线 (Visual Studio)

如何:使用 OvalShape 和 RectangleShape 控件绘制形状 (Visual Studio)