Control.GetPreferredSize(Size) 메서드
정의
컨트롤이 들어갈 수 있는 사각형 영역의 크기를 검색합니다.Retrieves the size of a rectangular area into which a control can be fitted.
public:
virtual System::Drawing::Size GetPreferredSize(System::Drawing::Size proposedSize);
public virtual System.Drawing.Size GetPreferredSize (System.Drawing.Size proposedSize);
abstract member GetPreferredSize : System.Drawing.Size -> System.Drawing.Size
override this.GetPreferredSize : System.Drawing.Size -> System.Drawing.Size
Public Overridable Function GetPreferredSize (proposedSize As Size) As Size
매개 변수
- proposedSize
- Size
컨트롤의 사용자 지정 크기 영역입니다.The custom-sized area for a control.
반환
사각형의 너비와 높이를 나타내는 Size 형식의 정렬된 쌍입니다.An ordered pair of type Size representing the width and height of a rectangle.
구현
설명
GetPreferredSize 동작은 컨트롤과 다릅니다.The behavior of GetPreferredSize differs by control. LayoutEngine에서 반환 된 크기를 컨트롤에 할당할 수 없는 것일 수 있습니다.The LayoutEngine might be unable to assign the returned size to the control. proposedSize
매개 변수에 표시 된 제약 조건 보다 큰 크기를 반환할 수 있지만 제약 조건이 감소 하면 proposedSize
감소 해야 합니다.You can return a size larger than the constraints indicated in the proposedSize
parameter, but proposedSize
should decrease as the constraint decreases. 예를 들어 GetPreferredSize(new Size(100, 0))
은 GetPreferredSize(new Size(200, 0))
보다 크지 않아야 합니다.For example, GetPreferredSize(new Size(100, 0))
should not be wider than GetPreferredSize(new Size(200, 0))
. 예외는 제한 없는 것으로 정의 된 0 또는 Size.Empty``proposedSize
입니다.The exception is a proposedSize
of 0 or Size.Empty
, which are defined as unconstrained.