DataGridViewCell.GetPreferredSize 메서드

정의

셀의 기본 크기를 픽셀 단위로 계산합니다.

protected:
 virtual System::Drawing::Size GetPreferredSize(System::Drawing::Graphics ^ graphics, System::Windows::Forms::DataGridViewCellStyle ^ cellStyle, int rowIndex, System::Drawing::Size constraintSize);
protected virtual System.Drawing.Size GetPreferredSize (System.Drawing.Graphics graphics, System.Windows.Forms.DataGridViewCellStyle cellStyle, int rowIndex, System.Drawing.Size constraintSize);
abstract member GetPreferredSize : System.Drawing.Graphics * System.Windows.Forms.DataGridViewCellStyle * int * System.Drawing.Size -> System.Drawing.Size
override this.GetPreferredSize : System.Drawing.Graphics * System.Windows.Forms.DataGridViewCellStyle * int * System.Drawing.Size -> System.Drawing.Size
Protected Overridable Function GetPreferredSize (graphics As Graphics, cellStyle As DataGridViewCellStyle, rowIndex As Integer, constraintSize As Size) As Size

매개 변수

graphics
Graphics

셀을 그리는 데 사용되는 Graphics입니다.

cellStyle
DataGridViewCellStyle

셀의 스타일을 나타내는 DataGridViewCellStyle입니다.

rowIndex
Int32

셀의 행 0부터 시작하는 인덱스입니다.

constraintSize
Size

셀에 허용되는 최대 크기입니다.

반환

Size

셀의 기본 크기를 픽셀 단위로 나타내는 Size입니다.

설명

기본 클래스 DataGridViewCell 의 메서드는 GetPreferredSize 항상 너비와 높이가 -1인 값을 반환 Size 합니다. 그러나 이 메서드는 적절한 값을 반환하기 위해 파생 셀 클래스에서 재정의됩니다.

적용 대상

추가 정보