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.

适用于

另请参阅