DataGridViewCheckBoxCell.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

一个 Size,它表示单元格的首选大小(以像素为单位)。

适用于

另请参阅