2009-10-08 6 views

답변

2

기본 클래스 구현을 호출하기 전에 SetBoundsCore 메서드를 재정의하고 height 값을 변경하여 높이 변경을 금지 할 수 있습니다.

private const int FixedHeightIWantToKeep = 100; 

protected override void SetBoundsCore(
    int x, 
    int y, 
    int width, 
    int height, 
    BoundsSpecified specified) 
{ 
    // Fixes height at 100 (or whatever fixed height is set to). 
    height = this.FixedHeightIWantToKeep; 
    base.SetBoundsCore(x, y, width, height, specified); 
} 
관련 문제