DataGridViewRowPostPaintEventArgs.PaintCellsBackground(Rectangle, Boolean) DataGridViewRowPostPaintEventArgs.PaintCellsBackground(Rectangle, Boolean) DataGridViewRowPostPaintEventArgs.PaintCellsBackground(Rectangle, Boolean) DataGridViewRowPostPaintEventArgs.PaintCellsBackground(Rectangle, Boolean) Method

定义

为指定边界中的区域绘制单元格背景。Paints the cell backgrounds for the area in the specified bounds.

public:
 void PaintCellsBackground(System::Drawing::Rectangle clipBounds, bool cellsPaintSelectionBackground);
public void PaintCellsBackground (System.Drawing.Rectangle clipBounds, bool cellsPaintSelectionBackground);
member this.PaintCellsBackground : System.Drawing.Rectangle * bool -> unit
Public Sub PaintCellsBackground (clipBounds As Rectangle, cellsPaintSelectionBackground As Boolean)

参数

clipBounds
Rectangle Rectangle Rectangle Rectangle

一个指定要绘制的 Rectangle 区域的 DataGridViewA Rectangle that specifies the area of the DataGridView to be painted.

cellsPaintSelectionBackground
Boolean Boolean Boolean Boolean

true 用于使用 SelectionBackColorInheritedStyle 属性的颜色绘制指定边界的背景;false 用于使用 BackColorInheritedStyle 属性的颜色绘制指定边界的背景。true to paint the background of the specified bounds with the color of the SelectionBackColor property of the InheritedStyle; false to paint the background of the specified bounds with the color of the BackColor property of the InheritedStyle.

异常

RowIndex 小于零或大于将 DataGridView 控件中的行数减一得到的值。RowIndex is less than zero or greater than the number of rows in the DataGridView control minus one.

适用于

另请参阅