다음을 통해 공유


Control.SetClientSizeCore 메서드

컨트롤 클라이언트 영역의 크기를 설정합니다.

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

구문

‘선언
Protected Overridable Sub SetClientSizeCore ( _
    x As Integer, _
    y As Integer _
)
‘사용 방법
Dim x As Integer
Dim y As Integer

Me.SetClientSizeCore(x, y)
protected virtual void SetClientSizeCore (
    int x,
    int y
)
protected:
virtual void SetClientSizeCore (
    int x, 
    int y
)
protected void SetClientSizeCore (
    int x, 
    int y
)
protected function SetClientSizeCore (
    x : int, 
    y : int
)

매개 변수

  • x
    클라이언트 영역의 너비(픽셀)입니다.
  • y
    클라이언트 영역의 높이(픽셀)입니다.

설명

클라이언트 영역이 (0, 0) 위치에서 시작하여 (x, y) 위치로 확장됩니다.

일반적으로 컨트롤의 ClientSize를 설정해서는 안 됩니다.

상속자 참고 사항 파생 클래스에서 SetClientSizeCore를 재정의하는 경우 ClientSize 속성을 조정할 수 있도록 기본 클래스의 SetClientSizeCore 메서드를 호출해야 합니다. 컨트롤에서의 그리기 작업에 대한 자세한 내용은 Windows Forms 컨트롤 렌더링을 참조하십시오.

예제

다음 코드 예제에서는 SetClientSizeCore 메서드를 재정의하여 컨트롤이 정사각형으로 유지되도록 합니다. 이 예제를 실행하려면 Control 클래스에서 직접 또는 간접적으로 파생된 클래스가 있어야 합니다.

Protected Overrides Sub SetClientSizeCore(x As Integer, y As Integer)
   ' Keep the client size square.
   If x > y Then
      MyBase.SetClientSizeCore(x, x)
   Else
      MyBase.SetClientSizeCore(y, y)
   End If
End Sub
protected override void SetClientSizeCore(int x, int y)
{
   // Keep the client size square.
   if(x > y)
   {
      base.SetClientSizeCore(x, x);
   }
   else
   {
      base.SetClientSizeCore(y, y);
   }
}
protected:
   virtual void SetClientSizeCore( int x, int y ) override
   {
      // Keep the client size square.
      if ( x > y )
      {
         UserControl::SetClientSizeCore( x, x );
      }
      else
      {
         UserControl::SetClientSizeCore( y, y );
      }
   }
protected void SetClientSizeCore(int x, int y)
{
    // Keep the client size square.
    if (x > y) {
        super.SetClientSizeCore(x, x);
    }
    else {
        super.SetClientSizeCore(y, y);
    }
} //SetClientSizeCore

플랫폼

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 네임스페이스
ClientSize