バージョン

GetPreferredSize(Graphics,DataGridViewCellStyle,Int32,Size) メソッド

ピクセル単位でセルの最適サイズを計算します。
シンタックス
'宣言
 
Protected Overrides Function GetPreferredSize( _
   ByVal graphics As Graphics, _
   ByVal cellStyle As DataGridViewCellStyle, _
   ByVal rowIndex As Integer, _
   ByVal constraintSize As Size _
) As Size
protected override Size GetPreferredSize( 
   Graphics graphics,
   DataGridViewCellStyle cellStyle,
   int rowIndex,
   Size constraintSize
)

パラメータ

graphics
測定に使用されるグラフィックスオブジェクト
cellStyle
セルのスタイル
rowIndex
セルのゼロから始まる行インデックス。
constraintSize
セルの許容される最大サイズ。

戻り値の型

ピクセル単位のセルの最適サイズを表す System.Drawing.Size
参照