Поделиться через


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.

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

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