Export (0) Print
Expand All

DataGridViewRow.DrawFocus Method

Draws a focus rectangle around the specified bounds.

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

protected internal virtual void DrawFocus (
	Graphics graphics,
	Rectangle clipBounds,
	Rectangle bounds,
	int rowIndex,
	DataGridViewElementStates rowState,
	DataGridViewCellStyle cellStyle,
	bool cellsPaintSelectionBackground
)
protected void DrawFocus (
	Graphics graphics, 
	Rectangle clipBounds, 
	Rectangle bounds, 
	int rowIndex, 
	DataGridViewElementStates rowState, 
	DataGridViewCellStyle cellStyle, 
	boolean cellsPaintSelectionBackground
)
protected internal function DrawFocus (
	graphics : Graphics, 
	clipBounds : Rectangle, 
	bounds : Rectangle, 
	rowIndex : int, 
	rowState : DataGridViewElementStates, 
	cellStyle : DataGridViewCellStyle, 
	cellsPaintSelectionBackground : boolean
)
Not applicable.

Parameters

graphics

The Graphics used to paint the DataGridViewRow.

clipBounds

A Rectangle that represents the area of the DataGridView that needs to be painted.

bounds

A Rectangle that contains the bounds of the DataGridViewRow that is being painted.

rowIndex

The row index of the cell that is being painted.

rowState

A bitwise combination of DataGridViewElementStates values that specifies the state of the row.

cellStyle

The DataGridViewCellStyle used to paint the focus rectangle.

cellsPaintSelectionBackground

true to use the SelectionBackColor property of cellStyle as the color of the focus rectangle; false to use the BackColor property of cellStyle as the color of the focus rectangle.

Exception typeCondition

InvalidOperationException

The row has not been added to a DataGridView control.

ArgumentNullException

graphics is a null reference (Nothing in Visual Basic).

-or-

cellStyle is a null reference (Nothing in Visual Basic).

The rowIndex parameter is not used in the base-class implementation of the DrawFocus method, although it can be used when overriding this method in a derived class.

Windows 98, Windows Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2015 Microsoft