다음을 통해 공유


Form.ClientSize 속성

폼의 클라이언트 영역 크기를 가져오거나 설정합니다.

네임스페이스: System.Windows.Forms
어셈블리: System.Windows.Forms(system.windows.forms.dll)

구문

‘선언
<LocalizableAttribute(True)> _
Public Property ClientSize As Size
‘사용 방법
Dim instance As Form
Dim value As Size

value = instance.ClientSize

instance.ClientSize = value
[LocalizableAttribute(true)] 
public Size ClientSize { get; set; }
[LocalizableAttribute(true)] 
public:
property Size ClientSize {
    Size get ();
    void set (Size value);
}
/** @property */
public Size get_ClientSize ()

/** @property */
public void set_ClientSize (Size value)
public function get ClientSize () : Size

public function set ClientSize (value : Size)

속성 값

폼의 클라이언트 영역 크기를 나타내는 Size입니다.

설명

폼의 클라이언트 영역 크기는 테두리 및 제목 표시줄을 제외한 폼의 크기입니다. 폼의 클라이언트 영역은 컨트롤을 배치할 수 있는 폼 내의 영역입니다. 이 속성을 사용하면 그래픽 작업을 수행하거나 폼의 컨트롤을 배치하고 크기를 조정할 때 적절한 크기를 결정할 수 있습니다. 전체 폼의 크기를 결정하려면 Size 속성을 사용하거나 개별 속성인 HeightWidth를 사용합니다.

예제

다음 코드 예제에서는 폼의 Resize 이벤트에 대한 이벤트 처리기를 만듭니다. 해당 이벤트 처리기는 폼의 ClientSize 속성을 사용하여 button1이라는 Button 컨트롤로 폼의 전체 클라이언트 영역을 채웁니다.

Private Sub MyForm_Resize(sender As Object, e As EventHandler)
    ' Set the size of button1 to the size of the client area of the form.
    button1.Size = Me.ClientSize
End Sub 'MyForm_Resize
private void MyForm_Resize (Object sender, EventHandler e)
 {
    // Set the size of button1 to the size of the client area of the form.
    button1.Size = this.ClientSize;
 }
    
private:
   void MyForm_Resize( Object^ sender, EventHandler^ e )
   {
      // Set the size of button1 to the size of the client area of the form.
      button1->Size = this->ClientSize;
   }
private void MyForm_Resize(Object sender, EventHandler e)
{
    // Set the size of button1 to the size of the client area of the form.
    button1.set_Size(this.get_ClientSize());
} //MyForm_Resize

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

Form 클래스
Form 멤버
System.Windows.Forms 네임스페이스
Size
Control.Height 속성
Control.Width 속성