DataGridViewComboBoxCell.GetPreferredSize 方法

定義

計算儲存格的慣用大小 (以像素為單位)。

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

參數

graphics
Graphics

用來繪製儲存格的 Graphics

cellStyle
DataGridViewCellStyle

代表儲存格樣式的 DataGridViewCellStyle

rowIndex
Int32

儲存格之以零為起始的資料列索引。

constraintSize
Size

儲存格可允許大小的最大值。

傳回

Size,表示儲存格的慣用大小 (以像素為單位)。

適用於

另請參閱