DataGridViewCell.ContentBounds DataGridViewCell.ContentBounds DataGridViewCell.ContentBounds DataGridViewCell.ContentBounds Property

定義

取得圍住儲存格內容區域的周框。Gets the bounding rectangle that encloses the cell's content area.

public:
 property System::Drawing::Rectangle ContentBounds { System::Drawing::Rectangle get(); };
[System.ComponentModel.Browsable(false)]
public System.Drawing.Rectangle ContentBounds { get; }
member this.ContentBounds : System.Drawing.Rectangle
Public ReadOnly Property ContentBounds As Rectangle

屬性值

圍住儲存格內容的 RectangleThe Rectangle that bounds the cell's contents.

例外狀況

包含儲存格的資料列是共用的資料列。The row containing the cell is a shared row.

-或--or-

儲存格是資料行行首儲存格。The cell is a column header cell.

ColumnIndex 屬性的值小於 0,表示儲存格是資料列行首儲存格。The value of the ColumnIndex property is less than 0, indicating that the cell is a row header cell.

備註

傳回的矩形會報告用戶端座標(以圖元為單位)。The returned rectangle reports client coordinates, in pixels.

這個屬性會呼叫GetContentBounds方法來取得其值。This property calls the GetContentBounds method to get its value. 對於基底DataGridViewCell類型,此值為EmptyFor the base DataGridViewCell type, this value is Empty.

若要取得儲存格的周框,而不是資料格內容, DataGridView.GetCellDisplayRectangle請使用方法。To get the bounding rectangle of the cell rather than the cell contents, use the DataGridView.GetCellDisplayRectangle method.

適用於

另請參閱