Form.DesktopLocation 속성

정의

Windows 데스크톱에서 폼의 위치를 가져오거나 설정합니다.

public:
 property System::Drawing::Point DesktopLocation { System::Drawing::Point get(); void set(System::Drawing::Point value); };
[System.ComponentModel.Browsable(false)]
public System.Drawing.Point DesktopLocation { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.DesktopLocation : System.Drawing.Point with get, set
Public Property DesktopLocation As Point

속성 값

Point

데스크톱에서 폼의 위치를 나타내는 Point입니다.

특성

예제

다음은 폼이 바탕 화면의 왼쪽 테두리에서 100픽셀, 바탕 화면 위쪽에서 100픽셀로 배치되도록 폼의 위치를 설정하는 예제입니다. 이 예제에서는 양식 클래스 내에서 메서드를 정의해야 합니다.

public:
   void MoveMyForm()
   {
      // Create a Point object that will be used as the location of the form.
      Point tempPoint = Point( 100, 100 );
      // Set the location of the form using the Point object.
      this->DesktopLocation = tempPoint;
   }
public void MoveMyForm()
 {
    // Create a Point object that will be used as the location of the form.
    Point tempPoint = new Point(100,100);
    // Set the location of the form using the Point object.
    this.DesktopLocation = tempPoint;
 }
Public Sub MoveMyForm()
    ' Create a Point object that will be used as the location of the form.
    Dim tempPoint As New Point(100, 100)
    ' Set the location of the form using the Point object.
    DesktopLocation = tempPoint
End Sub

설명

바탕 화면 좌표는 작업 표시줄을 제외하는 화면의 작업 영역을 기반으로 합니다. 바탕 화면의 좌표계는 픽셀 기반입니다. 애플리케이션은 다중 모니터 시스템에서 실행 하는 경우 폼의 좌표가 결합 된 바탕 화면 좌표입니다.

Windows 바탕 화면에서 다른 폼과 애플리케이션을 기준으로 폼을 배치 하려면이 속성을 사용할 수 있습니다.

메서드를 SetDesktopLocation 호출하기 전에 메서드를 Show 호출하면 양식이 운영 체제에 의해 결정되는 기본 위치에 배치됩니다. 창 위치 지정에 대한 자세한 내용은 "창 기능" 문서의 창 크기 및 위치 섹션을 참조하세요.

통화 Show후 전화를 걸 SetDesktopLocation 면 양식이 지정한 위치에 배치됩니다.

적용 대상

추가 정보