Form.DesktopLocation 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
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
속성 값
바탕 화면에 있는 양식의 위치를 나타내는 A 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 호출하면 양식이 운영 체제에 의해 결정되는 기본 위치에 배치됩니다. 창 위치 지정에 대한 자세한 내용은 "창 기능" 문서의 창 크기 및 위치 섹션을 참조하세요.
호출 SetDesktopLocation후 호출 Show 하면 양식이 지정한 위치에 배치됩니다.