Form.DesktopBounds 속성

정의

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

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

속성 값

데스크톱 좌표를 사용하여 Windows 데스크톱에서 폼의 경계를 나타내는 Rectangle입니다.

특성

예제

다음 예제에서는 폼의 크기와 위치를 설정하여 폼이 바탕 화면의 왼쪽 테두리에서 50픽셀, 바탕 화면 위쪽에서 50픽셀 위치에 배치되도록 합니다. 이 예제에서는 메서드가 양식 클래스 내에서 정의되어야 합니다.

public:
   void MoveMyForm()
   {
      // Create a Rectangle object that will be used as the bound of the form.
      Rectangle tempRect = Rectangle( 50, 50, 100, 100 );
      // Set the bounds of the form using the Rectangle object.
      this->DesktopBounds = tempRect;
   }
public void MoveMyForm()
 {
    // Create a Rectangle object that will be used as the bound of the form.
    Rectangle tempRect = new Rectangle(50,50,100,100);
    //  Set the bounds of the form using the Rectangle object.
    this.DesktopBounds = tempRect;
 }
Public Sub MoveMyForm()
    ' Create a Rectangle object that will be used as the bound of the form.
    Dim tempRect As New Rectangle(50, 50, 100, 100)
    '  Set the bounds of the form using the Rectangle object.
    DesktopBounds = tempRect
End Sub

설명

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

이 속성은 크기와 다른 폼 이나 애플리케이션을 기준으로 폼을 Windows 바탕 화면에서 위치를 사용할 수 있습니다.

적용 대상

추가 정보