DataGridViewColumnHeaderCell.GetContentBounds メソッド

定義

セルの内容領域を囲む外接する四角形を返します。これは、指定された Graphics オブジェクトとセル スタイルを使用して計算されます。

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

パラメーター

graphics
Graphics

セルのグラフィックス コンテキスト。

cellStyle
DataGridViewCellStyle

セルに適用する DataGridViewCellStyle

rowIndex
Int32

セルの親行のインデックス。

戻り値

セルの内容領域に外接する Rectangle

例外

rowIndex が -1 ではありません。

注釈

セルの内容のサイズは、このメソッドが呼び出されると動的に計算されます。 このメソッドは、 プロパティの読み取り時に内部的に ContentBounds 呼び出されます。

適用対象

こちらもご覧ください