DataGridViewCell.GetContentBounds DataGridViewCell.GetContentBounds DataGridViewCell.GetContentBounds DataGridViewCell.GetContentBounds Method

Definition

Returns the bounding rectangle that encloses the cell's content area.

Overloads

GetContentBounds(Int32) GetContentBounds(Int32) GetContentBounds(Int32) GetContentBounds(Int32)

Returns the bounding rectangle that encloses the cell's content area using a default Graphics and cell style currently in effect for the cell.

GetContentBounds(Graphics, DataGridViewCellStyle, Int32) GetContentBounds(Graphics, DataGridViewCellStyle, Int32) GetContentBounds(Graphics, DataGridViewCellStyle, Int32)

Returns the bounding rectangle that encloses the cell's content area, which is calculated using the specified Graphics and cell style.

GetContentBounds(Int32) GetContentBounds(Int32) GetContentBounds(Int32) GetContentBounds(Int32)

Returns the bounding rectangle that encloses the cell's content area using a default Graphics and cell style currently in effect for the cell.

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

Parameters

rowIndex
Int32 Int32 Int32 Int32

The index of the cell's parent row.

Returns

The Rectangle that bounds the cell's contents.

Exceptions

The specified rowIndex is less than 0 or greater than the number of rows in the control minus 1.

Remarks

The size of the cell's contents is computed dynamically when this method is called. The base class implementation always returns Rectangle.Empty.

See also

GetContentBounds(Graphics, DataGridViewCellStyle, Int32) GetContentBounds(Graphics, DataGridViewCellStyle, Int32) GetContentBounds(Graphics, DataGridViewCellStyle, Int32)

Returns the bounding rectangle that encloses the cell's content area, which is calculated using the specified Graphics and cell style.

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

Parameters

graphics
Graphics Graphics Graphics Graphics

The graphics context for the cell.

rowIndex
Int32 Int32 Int32 Int32

The index of the cell's parent row.

Returns

The Rectangle that bounds the cell's contents.

Remarks

The size of the cell's contents is computed dynamically when this method is called. The base class implementation always returns Rectangle.Empty.

This method is called internally when the ContentBounds property is read.

See also

Applies to