Screen.GetWorkingArea 메서드

정의

디스플레이의 작업 영역을 검색합니다.

오버로드

GetWorkingArea(Point)

지정된 위치에 가장 가까운 작업 영역을 검색합니다. 작업 영역은 작업 표시줄, 도킹된 창 및 도킹된 도구 모음을 제외한 디스플레이의 데스크톱 영역입니다.

GetWorkingArea(Rectangle)

지정된 사각형의 영역이 가장 큰 디스플레이의 작업 영역을 검색합니다. 작업 영역은 작업 표시줄, 도킹된 창 및 도킹된 도구 모음을 제외한 디스플레이의 데스크톱 영역입니다.

GetWorkingArea(Control)

지정된 컨트롤의 영역이 가장 큰 디스플레이의 작업 영역을 검색합니다. 작업 영역은 작업 표시줄, 도킹된 창 및 도킹된 도구 모음을 제외한 디스플레이의 데스크톱 영역입니다.

GetWorkingArea(Point)

지정된 위치에 가장 가까운 작업 영역을 검색합니다. 작업 영역은 작업 표시줄, 도킹된 창 및 도킹된 도구 모음을 제외한 디스플레이의 데스크톱 영역입니다.

public:
 static System::Drawing::Rectangle GetWorkingArea(System::Drawing::Point pt);
public static System.Drawing.Rectangle GetWorkingArea (System.Drawing.Point pt);
static member GetWorkingArea : System.Drawing.Point -> System.Drawing.Rectangle
Public Shared Function GetWorkingArea (pt As Point) As Rectangle

매개 변수

pt
Point

작업 영역을 검색할 좌표를 지정하는 Point입니다.

반환

Rectangle

작업 영역을 지정하는 Rectangle입니다. 어떠한 디스플레이에도 지정된 위치가 포함되어 있지 않은 여러 디스플레이 환경에서는 반환된 위치에 가장 가까운 디스플레이가 반환됩니다.

예제

다음 코드 예제는 사용 방법을 보여 줍니다 PrimaryScreen 속성 및 GetWorkingArea 메서드. 이 메서드에 필요한 라는 단추가 포함 된 폼 Button1

   // This method will adjust the size of the form to utilize 
   // the working area of the screen.
private:
   void Button1_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ )
   {
      // Retrieve the working rectangle from the Screen class
      // using the PrimaryScreen and the WorkingArea properties.
      System::Drawing::Rectangle workingRectangle = Screen::PrimaryScreen->WorkingArea;
      
      // Set the size of the form slightly less than size of 
      // working rectangle.
      this->Size = System::Drawing::Size( workingRectangle.Width - 10, workingRectangle.Height - 10 );
      
      // Set the location so the entire form is visible.
      this->Location = System::Drawing::Point( 5, 5 );
   }
// This method will adjust the size of the form to utilize 
// the working area of the screen.
private void Button1_Click(System.Object sender, System.EventArgs e)
{
    // Retrieve the working rectangle from the Screen class
    // using the PrimaryScreen and the WorkingArea properties.
    System.Drawing.Rectangle workingRectangle = 
        Screen.PrimaryScreen.WorkingArea;
    
    // Set the size of the form slightly less than size of 
    // working rectangle.
    this.Size = new System.Drawing.Size(
        workingRectangle.Width-10, workingRectangle.Height-10);

    // Set the location so the entire form is visible.
    this.Location = new System.Drawing.Point(5, 5);
}
' This method will adjust the size of the form to utilize 
' the working area of the screen.

Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click

    ' Retrieve the working rectangle from the Screen class
    ' using the PrimaryScreen and the WorkingArea properties. 
    Dim workingRectangle As System.Drawing.Rectangle = _
        Screen.PrimaryScreen.WorkingArea

    ' Set the size of the form slightly less than size of 
    ' working rectangle.
    Me.Size = New System.Drawing.Size(workingRectangle.Width - 10, _
        workingRectangle.Height - 10)

    ' Set the location so the entire form is visible.
    Me.Location = New System.Drawing.Point(5, 5)

End Sub

적용 대상

GetWorkingArea(Rectangle)

지정된 사각형의 영역이 가장 큰 디스플레이의 작업 영역을 검색합니다. 작업 영역은 작업 표시줄, 도킹된 창 및 도킹된 도구 모음을 제외한 디스플레이의 데스크톱 영역입니다.

public:
 static System::Drawing::Rectangle GetWorkingArea(System::Drawing::Rectangle rect);
public static System.Drawing.Rectangle GetWorkingArea (System.Drawing.Rectangle rect);
static member GetWorkingArea : System.Drawing.Rectangle -> System.Drawing.Rectangle
Public Shared Function GetWorkingArea (rect As Rectangle) As Rectangle

매개 변수

rect
Rectangle

작업 영역을 검색할 영역을 지정하는 Rectangle입니다.

반환

Rectangle

작업 영역을 지정하는 Rectangle입니다. 어떠한 디스플레이에도 지정된 사각형이 포함되어 있지 않은 여러 디스플레이 환경에서는 사각형에 가장 가까운 디스플레이가 반환됩니다.

적용 대상

GetWorkingArea(Control)

지정된 컨트롤의 영역이 가장 큰 디스플레이의 작업 영역을 검색합니다. 작업 영역은 작업 표시줄, 도킹된 창 및 도킹된 도구 모음을 제외한 디스플레이의 데스크톱 영역입니다.

public:
 static System::Drawing::Rectangle GetWorkingArea(System::Windows::Forms::Control ^ ctl);
public static System.Drawing.Rectangle GetWorkingArea (System.Windows.Forms.Control ctl);
static member GetWorkingArea : System.Windows.Forms.Control -> System.Drawing.Rectangle
Public Shared Function GetWorkingArea (ctl As Control) As Rectangle

매개 변수

ctl
Control

작업 영역을 검색할 Control입니다.

반환

Rectangle

작업 영역을 지정하는 Rectangle입니다. 어떠한 디스플레이에도 지정된 컨트롤이 포함되어 있지 않은 여러 디스플레이 환경에서는 지정된 컨트롤에 가장 가까운 디스플레이가 반환됩니다.

적용 대상