DataGridViewCell.GetPreferredSize 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
셀의 기본 크기를 픽셀 단위로 계산합니다.
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
매개 변수
- cellStyle
- DataGridViewCellStyle
셀의 스타일을 나타내는 DataGridViewCellStyle입니다.
- rowIndex
- Int32
셀의 행 0부터 시작하는 인덱스입니다.
- constraintSize
- Size
셀에 허용되는 최대 크기입니다.
반환
셀의 기본 크기를 픽셀 단위로 나타내는 Size입니다.
설명
기본 클래스 DataGridViewCell 의 메서드는 GetPreferredSize 항상 너비와 높이가 -1인 값을 반환 Size 합니다. 그러나 이 메서드는 적절한 값을 반환하기 위해 파생 셀 클래스에서 재정의됩니다.