FormStartPosition 열거형

정의

폼의 초기 위치를 지정합니다.

public enum class FormStartPosition
[System.Runtime.InteropServices.ComVisible(true)]
public enum FormStartPosition
public enum FormStartPosition
[<System.Runtime.InteropServices.ComVisible(true)>]
type FormStartPosition = 
type FormStartPosition = 
Public Enum FormStartPosition
상속
FormStartPosition
특성

필드

CenterParent 4

폼이 해당 부모 폼의 범위 내에서 가운데에 맞춰집니다.

CenterScreen 1

폼이 현재 디스플레이의 가운데에 맞춰지며 크기는 해당 폼의 크기 내에서 지정됩니다.

Manual 0

폼의 위치는 Location 속성에 의해 결정됩니다.

WindowsDefaultBounds 3

폼은 Windows 기본 위치에 배치되며 범위는 Windows 기본값에 의해 결정됩니다.

WindowsDefaultLocation 2

폼은 Windows 기본 위치에 배치되며 크기는 해당 폼의 크기 내에서 지정됩니다.

예제

이 예제에서는 폼의 시작 위치를 화면 가운데로 변경하고 레이블을 사용하여 위치 정보를 표시합니다. 이 예제에서는 이미 명명Form1된 이름을 만들었다고 가정합니다Form.

public:
   void InitMyForm()
   {
      // Adds a label to the form.
      Label^ label1 = gcnew Label;
      label1->Location = System::Drawing::Point( 54, 128 );
      label1->Name = "label1";
      label1->Size = System::Drawing::Size( 220, 80 );
      label1->Text = "Start position information";
      this->Controls->Add( label1 );
      
      // Moves the start position to the center of the screen.
      StartPosition = FormStartPosition::CenterScreen;
      
      // Displays the position information.
      label1->Text = String::Format( "The start position is {0}", StartPosition );
   }
public void InitMyForm()
{
    // Adds a label to the form.
    Label label1 = new Label();
    label1.Location = new System.Drawing.Point(54, 128);
    label1.Name = "label1";
    label1.Size = new System.Drawing.Size(220, 80);
    label1.Text = "Start position information";
    this.Controls.Add(label1);

    // Moves the start position to the center of the screen.
    StartPosition = FormStartPosition.CenterScreen;
    // Displays the position information.
    label1.Text = "The start position is " + StartPosition;	
}
Public Sub InitMyForm()
   ' Adds a label to the form.
   Dim label1 As New Label()
   label1.Location = New System.Drawing.Point(54, 128)
   label1.Name = "label1"
   label1.Size = New System.Drawing.Size(220, 80)
   label1.Text = "Start position information"
   Me.Controls.Add(label1)
   
   ' Moves the start position to the center of the screen.
   StartPosition = FormStartPosition.CenterScreen
   ' Displays the position information.
   label1.Text = "The start position is " + StartPosition
End Sub

설명

이 열거형은에서 사용 합니다 StartPosition 의 속성을 Form 클래스. 폼의 다른 시작 위치를 나타냅니다. 기본 시작 위치는 .입니다 WindowsDefaultLocation.

적용 대상

추가 정보