다음을 통해 공유


Control.DefaultSize 속성

컨트롤의 기본 크기를 가져옵니다.

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

구문

‘선언
Protected Overridable ReadOnly Property DefaultSize As Size
‘사용 방법
Dim value As Size

value = Me.DefaultSize
protected virtual Size DefaultSize { get; }
protected:
virtual property Size DefaultSize {
    Size get ();
}
/** @property */
protected Size get_DefaultSize ()
protected function get DefaultSize () : Size

속성 값

컨트롤의 기본 Size입니다.

설명

DefaultSize 속성은 작성된 해당 컨트롤의 처음 Size를 나타냅니다. Size 속성 값을 설정하여 컨트롤의 크기를 조정할 수 있습니다.

참고

보다 향상된 성능을 유지하려면 컨트롤의 생성자에 해당 컨트롤의 Size를 설정하지 않아야 합니다. 더 좋은 방법은 DefaultSize 속성을 재정의하는 것입니다.

상속자 참고 사항 파생 클래스의 DefaultSize 속성을 재정의하는 경우 전체 구현을 재정의하지 않고 원하는 크기의 Size를 반환하는 것이 좋습니다.

예제

다음 코드 예제에서는 DefaultSize 속성을 재정의하고 폼의 기본 크기를 500 x 500픽셀로 만듭니다.

Protected Overrides ReadOnly Property DefaultSize() As Size
   Get
      ' Set the default size of
      ' the form to 500 pixels square. 
      Return New Size(500, 500)
   End Get
End Property
protected override Size DefaultSize
{
   get
   {
      // Set the default size of
      // the form to 500 pixels square.
      return new Size(500,500);
   }
}
protected:
   property System::Drawing::Size DefaultSize 
   {
      virtual System::Drawing::Size get() override
      {
         // Set the default size of
         // the form to 500 pixels square.
         return System::Drawing::Size( 500, 500 );
      }
   }
/** @property 
 */
protected Size get_DefaultSize()
{
    // Set the default size of
    // the form to 500 pixels square.
    return new Size(500, 500);
}

플랫폼

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에서 지원

참고 항목

참조

Control 클래스
Control 멤버
System.Windows.Forms 네임스페이스
Control.Size
Size