FormStartPosition 열거형
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
폼의 초기 위치를 지정합니다.
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
- 상속
- 특성
필드
| Name | 값 | Description |
|---|---|---|
| Manual | 0 | 폼의 위치는 속성에 의해 결정됩니다 Location . |
| CenterScreen | 1 | 양식은 현재 디스플레이의 가운데에 있으며 폼의 크기로 지정된 차원이 있습니다. |
| WindowsDefaultLocation | 2 | 양식은 Windows 기본 위치에 위치하며 폼 크기에 지정된 차원이 있습니다. |
| WindowsDefaultBounds | 3 | 양식은 Windows 기본 위치에 위치하며 Windows에서 기본적으로 결정되는 범위를 가집니다. |
| CenterParent | 4 | 양식은 부모 폼의 범위 내에서 가운데에 배치됩니다. |
예제
이 예제에서는 폼의 시작 위치를 화면 가운데로 변경하고 레이블을 사용하여 위치 정보를 표시합니다. 이 예제에서는 명명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
설명
이 열거형은 클래스의 속성에 StartPositionForm 사용됩니다. 폼의 다른 시작 위치를 나타냅니다. 기본 시작 위치는 .입니다 WindowsDefaultLocation.