다음을 통해 공유


SimpleShape.Width 속성

도형의 너비를 가져오거나 설정 합니다.

네임스페이스:  Microsoft.VisualBasic.PowerPacks
어셈블리:  Microsoft.VisualBasic.PowerPacks.Vs(Microsoft.VisualBasic.PowerPacks.Vs.dll)

구문

‘선언
<BrowsableAttribute(False)> _
Public Property Width As Integer
[BrowsableAttribute(false)]
public int Width { get; set; }
[BrowsableAttribute(false)]
public:
property int Width {
    int get ();
    void set (int value);
}
[<BrowsableAttribute(false)>]
member Width : int with get, set
function get Width () : int
function set Width (value : int)

속성 값

형식: System.Int32
픽셀 단위로 도형의 너비입니다.

설명

변경의 Width 및 Left 속성 값이 원인의 Right 속성 값을 변경 하려면 셰이프입니다.

사용할 수 있습니다의 Size 속성을 모두 변경 하려면는 Height 및 Width 속성 또는 사용의 SetBounds 셰이프의 크기와 위치에는 단일 문 변경 하는 방법.

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다.는 Height 및 Width 셰이프의 크기를 변경 하는 속성입니다.이 예제에서는 사용자가 있어야는 OvalShape 폼에 OvalShape1 이라는 컨트롤입니다.

Private Sub OvalShape1_Click() Handles OvalShape1.Click
    ' Set the height.
    OvalShape1.Height = OvalShape1.Height + 50
    ' Set the width the same as the height to make it a circle.
    OvalShape1.Width = OvalShape1.Height
End Sub
private void ovalShape1_Click(System.Object sender, System.EventArgs e)
{
    // Set the height.
    ovalShape1.Height = ovalShape1.Height + 50;
    // Set the width the same as the height to make it a circle.
    ovalShape1.Width = ovalShape1.Height;
}

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

SimpleShape 클래스

Microsoft.VisualBasic.PowerPacks 네임스페이스

기타 리소스

Line 및 Shape 컨트롤 소개(Visual Studio)

방법: LineShape 컨트롤로 선 그리기(Visual Studio)

방법: OvalShape 및 RectangleShape 컨트롤을 사용하여 도형 그리기(Visual Studio)