DataGridViewRow.PaintCells Метод

Определение

Закрашивает ячейки в текущей строке.

protected public:
 virtual void PaintCells(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 PaintCells (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 PaintCells : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Rectangle * int * System.Windows.Forms.DataGridViewElementStates * bool * bool * System.Windows.Forms.DataGridViewPaintParts -> unit
override this.PaintCells : 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 PaintCells (graphics As Graphics, clipBounds As Rectangle, rowBounds As Rectangle, rowIndex As Integer, rowState As DataGridViewElementStates, isFirstDisplayedRow As Boolean, isLastVisibleRow As Boolean, paintParts As DataGridViewPaintParts)

Параметры

graphics
Graphics

Объект Graphics, используемый для закрашивания DataGridViewRow.

clipBounds
Rectangle

Объект Rectangle, представляющий область DataGridView, которую требуется закрасить.

rowBounds
Rectangle

Объект Rectangle, содержащий границы закрашиваемого DataGridViewRow.

rowIndex
Int32

Индекс строки, содержащей закрашиваемую ячейку.

rowState
DataGridViewElementStates

Поразрядная комбинация значений DataGridViewElementStates, которая задает состояние строки.

isFirstDisplayedRow
Boolean

Значение true, чтобы указать, что текущая строка является первой строкой, отображаемой в DataGridView; в противном случае — false.

isLastVisibleRow
Boolean

Значение true, чтобы указать, что текущая строка является последней строкой в представлении DataGridView, где значение свойства Visible равно true; в противном случае — false.

paintParts
DataGridViewPaintParts

Поразрядная комбинация значений DataGridViewPaintParts, указывающая части ячейки, которые необходимо закрасить.

Исключения

Строка не добавлена в элемент управления DataGridView.

Параметр paintParts не является допустимым побитовым сочетанием значений DataGridViewPaintParts.

Комментарии

Элемент DataGridView управления вызывает этот метод для рисования ячеек в строке, за исключением случаев, когда обработчик события DataGridView.RowPrePaint задает свойству HandledEventArgs.Handled значение true. Для получения дополнительной информации см. Paint.

Применяется к

См. также раздел