DataGridViewCell.GetPreferredSize Yöntem

Tanım

Hücrenin tercih edilen boyutunu piksel cinsinden hesaplar.

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

Parametreler

graphics
Graphics

Hücreyi Graphics çizmek için kullanılan.

cellStyle
DataGridViewCellStyle

DataGridViewCellStyle Hücrenin stilini temsil eden bir.

rowIndex
Int32

Hücrenin sıfır tabanlı satır dizini.

constraintSize
Size

Hücrenin izin verilen en büyük boyutu.

Döndürülenler

Size Hücrenin piksel cinsinden tercih edilen boyutunu temsil eden bir.

Açıklamalar

GetPreferredSize Temel sınıftaki DataGridViewCell yöntemi her zaman -1 genişliğine ve yüksekliğine sahip bir döndürürSize. Ancak, bu yöntem uygun değerleri döndürmek için türetilmiş hücre sınıflarında geçersiz kılındı.

Şunlara uygulanır

Ayrıca bkz.