Language

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 プロパティの読み取り時に内部的に呼び出されます。

適用対象

こちらもご覧ください