DataGridViewRowPrePaintEventArgs.PaintCellsBackground Metoda

Definice

Vykreslí pozadí buňky pro oblast v zadaných mezích.

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)

Parametry

clipBounds
Rectangle

A Rectangle , který určuje oblast DataGridView malovaného pole.

cellsPaintSelectionBackground
Boolean

true nakreslit pozadí zadaných hranic barvou SelectionBackColor vlastnosti objektu InheritedStyle; false a nakreslit pozadí zadaných hranic barvou BackColor vlastnosti objektu InheritedStyle.

Výjimky

RowIndex je menší než nula nebo větší než počet řádků v ovládacím DataGridView prvku minus jeden.

Poznámky

Metodu PaintCellsBackground použijte, když sami nakreslíte DataGridViewRow obsah buněk a . Pokud ručně vykreslujete celý řádek a obsah jeho buněk, nastavte HandledEventArgs.Handled vlastnost na true. Když HandledEventArgs.Handled je true, k událostem CellPainting a RowPostPaint nedojde.

Platí pro

Viz také