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

セルの 0 から始まる行インデックス番号。

constraintSize
Size

セルの最大許容サイズ。

戻り値

セルの推奨されるサイズをピクセル単位で表す Size

適用対象

こちらもご覧ください