Export (0) Print
Expand All

DataGridViewCellPaintingEventArgs.PaintBackground Method

Note: This method is new in the .NET Framework version 2.0.

Paints the cell background for the area in the specified bounds.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public void PaintBackground (
	Rectangle clipBounds,
	bool cellsPaintSelectionBackground
)
public void PaintBackground (
	Rectangle clipBounds, 
	boolean cellsPaintSelectionBackground
)
public function PaintBackground (
	clipBounds : Rectangle, 
	cellsPaintSelectionBackground : boolean
)

Parameters

clipBounds

A Rectangle that specifies the area of the DataGridView to be painted.

cellsPaintSelectionBackground

true to paint the background of the specified bounds with the color of the SelectionBackColor property of the DataGridViewCell.InheritedStyle; false to paint the background of the specified bounds with the color of the BackColor property of the DataGridViewCell.InheritedStyle.

Exception typeCondition

InvalidOperationException

RowIndex is less than -1 or greater than or equal to the number of rows in the DataGridView control.

-or-

ColumnIndex is less than -1 or greater than or equal to the number of columns in the DataGridView control.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft