BoundsSpecified 열거형

정의

컨트롤의 크기 및 위치를 정의할 때 사용할 컨트롤의 범위를 지정합니다.

이 열거형은 멤버 값의 비트 조합을 지원합니다.

public enum class BoundsSpecified
[System.Flags]
public enum BoundsSpecified
[<System.Flags>]
type BoundsSpecified = 
Public Enum BoundsSpecified
상속
BoundsSpecified
특성

필드

All 15

LocationSize 속성 값이 모두 정의되도록 지정합니다.

Height 8

컨트롤의 높이가 정의되도록 지정합니다.

Location 3

컨트롤의 XY 좌표가 모두 정의되도록 지정합니다.

None 0

범위를 지정하지 않았습니다.

Size 12

컨트롤의 WidthHeight 속성 값이 모두 정의되도록 지정합니다.

Width 4

컨트롤의 너비가 정의되도록 지정합니다.

X 1

컨트롤의 왼쪽 가장자리가 정의되도록 지정합니다.

Y 2

컨트롤의 위쪽 가장자리가 정의되도록 지정합니다.

예제

private:
   void MyForm_Layout( Object^ /*sender*/, System::Windows::Forms::LayoutEventArgs^ /*e*/ )
   {
      // Center the Form on the user's screen everytime it requires a Layout.
      this->SetBounds( (Screen::GetBounds( this ).Width / 2) - (this->Width / 2), (Screen::GetBounds( this ).Height / 2) - (this->Height / 2), this->Width, this->Height, BoundsSpecified::Location );
   }
private void MyForm_Layout(object sender, System.Windows.Forms.LayoutEventArgs e)
{
   // Center the Form on the user's screen everytime it requires a Layout.
   this.SetBounds((Screen.GetBounds(this).Width/2) - (this.Width/2),
       (Screen.GetBounds(this).Height/2) - (this.Height/2),
       this.Width, this.Height, BoundsSpecified.Location);	
}

Private Sub MyForm_Layout(ByVal sender As Object, _
    ByVal e As System.Windows.Forms.LayoutEventArgs) Handles MyBase.Layout

    ' Center the Form on the user's screen everytime it requires a Layout.
    Me.SetBounds((System.Windows.Forms.Screen.GetBounds(Me).Width / 2) - (Me.Width / 2), _
        (System.Windows.Forms.Screen.GetBounds(Me).Height / 2) - (Me.Height / 2), _
        Me.Width, Me.Height, System.Windows.Forms.BoundsSpecified.Location)
End Sub

설명

호출할 때이 열거형의 멤버를 사용 합니다 SetBoundsCoreSetBounds 의 메서드는 Control 클래스입니다.

적용 대상

추가 정보