語言

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 讀取屬性時,此方法會在內部被呼叫。

適用於

另請參閱