Edit

Share via


DataGridViewRow.PaintHeader Method

Definition

Paints the header cell of the current row.

protected public:
 virtual void PaintHeader(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle clipBounds, System::Drawing::Rectangle rowBounds, int rowIndex, System::Windows::Forms::DataGridViewElementStates rowState, bool isFirstDisplayedRow, bool isLastVisibleRow, System::Windows::Forms::DataGridViewPaintParts paintParts);
protected internal virtual void PaintHeader (System.Drawing.Graphics graphics, System.Drawing.Rectangle clipBounds, System.Drawing.Rectangle rowBounds, int rowIndex, System.Windows.Forms.DataGridViewElementStates rowState, bool isFirstDisplayedRow, bool isLastVisibleRow, System.Windows.Forms.DataGridViewPaintParts paintParts);
abstract member PaintHeader : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Rectangle * int * System.Windows.Forms.DataGridViewElementStates * bool * bool * System.Windows.Forms.DataGridViewPaintParts -> unit
override this.PaintHeader : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Rectangle * int * System.Windows.Forms.DataGridViewElementStates * bool * bool * System.Windows.Forms.DataGridViewPaintParts -> unit
Protected Friend Overridable Sub PaintHeader (graphics As Graphics, clipBounds As Rectangle, rowBounds As Rectangle, rowIndex As Integer, rowState As DataGridViewElementStates, isFirstDisplayedRow As Boolean, isLastVisibleRow As Boolean, paintParts As DataGridViewPaintParts)

Parameters

graphics
Graphics

The Graphics used to paint the DataGridViewRow.

clipBounds
Rectangle

A Rectangle that represents the area of the DataGridView that needs to be painted.

rowBounds
Rectangle

A Rectangle that contains the bounds of the DataGridViewRow that is being painted.

rowIndex
Int32

The row index of the cell that is being painted.

rowState
DataGridViewElementStates

A bitwise combination of DataGridViewElementStates values that specifies the state of the row.

isFirstDisplayedRow
Boolean

true to indicate that the current row is the first row displayed in the DataGridView; otherwise, false.

isLastVisibleRow
Boolean

true to indicate that the current row is the last row in the DataGridView that has the Visible property set to true; otherwise, false.

paintParts
DataGridViewPaintParts

A bitwise combination of DataGridViewPaintParts values indicating the parts of the cells to paint.

Exceptions

The row has not been added to a DataGridView control.

paintParts in not a valid bitwise combination of DataGridViewPaintParts values.

Remarks

The DataGridView control calls this method to paint the row header except when a handler for the DataGridView.RowPrePaint event sets the HandledEventArgs.Handled property to true. For more information, see Paint.

Applies to

See also