다음을 통해 공유


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)