語言

DataGridViewCell.GetContentBounds 方法

定義

回傳包圍該單元內容區域的邊界矩形。

多載

名稱 Description
GetContentBounds(Int32)

回傳包圍該儲存格內容區域的邊界矩形,使用 Graphics 預設且目前該儲存格有效的儲存格風格。

GetContentBounds(Graphics, DataGridViewCellStyle, Int32)

回傳包圍儲存格內容區域的邊界矩形,該區域是使用指定的 Graphics 和 儲存格樣式計算的。

GetContentBounds(Int32)

來源:
DataGridViewCell.cs
來源:
DataGridViewCell.cs
來源:
DataGridViewCell.cs
來源:
DataGridViewCell.cs
來源:
DataGridViewCell.cs

回傳包圍該儲存格內容區域的邊界矩形,使用 Graphics 預設且目前該儲存格有效的儲存格風格。

public:
 System::Drawing::Rectangle GetContentBounds(int rowIndex);
public System.Drawing.Rectangle GetContentBounds(int rowIndex);
member this.GetContentBounds : int -> System.Drawing.Rectangle
Public Function GetContentBounds (rowIndex As Integer) As Rectangle

參數

rowIndex
Int32

該格子父列的索引。

傳回

那 Rectangle 個界定牢房內容物的範圍。

例外狀況

指定的 rowIndex 值小於 0 或大於控制項中行數減 1。

ColumnIndex 小於 0,表示該儲存格是列標頭儲存格。

備註

當呼叫此方法時,儲存格內容的大小會動態計算。 基底類別實作總是回傳 Rectangle.Empty。

另請參閱

適用於

GetContentBounds(Graphics, DataGridViewCellStyle, Int32)

來源:
DataGridViewCell.cs
來源:
DataGridViewCell.cs
來源:
DataGridViewCell.cs
來源:
DataGridViewCell.cs
來源:
DataGridViewCell.cs

回傳包圍儲存格內容區域的邊界矩形,該區域是使用指定的 Graphics 和 儲存格樣式計算的。

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

參數

graphics
Graphics

儲存格的圖形上下文。

cellStyle
DataGridViewCellStyle

DataGridViewCellStyle將應用於細胞。

rowIndex
Int32

該格子父列的索引。

傳回

那 Rectangle 個界定牢房內容物的範圍。

備註

當呼叫此方法時,儲存格內容的大小會動態計算。 基底類別實作總是回傳 Rectangle.Empty。

當 ContentBounds 讀取屬性時,此方法會在內部被呼叫。

另請參閱

適用於