DataGridViewRow.DrawFocus 方法

定义

围绕指定边界绘制聚焦框。

protected public:
 virtual void DrawFocus(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle clipBounds, System::Drawing::Rectangle bounds, int rowIndex, System::Windows::Forms::DataGridViewElementStates rowState, System::Windows::Forms::DataGridViewCellStyle ^ cellStyle, bool cellsPaintSelectionBackground);
protected internal virtual void DrawFocus (System.Drawing.Graphics graphics, System.Drawing.Rectangle clipBounds, System.Drawing.Rectangle bounds, int rowIndex, System.Windows.Forms.DataGridViewElementStates rowState, System.Windows.Forms.DataGridViewCellStyle cellStyle, bool cellsPaintSelectionBackground);
abstract member DrawFocus : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Rectangle * int * System.Windows.Forms.DataGridViewElementStates * System.Windows.Forms.DataGridViewCellStyle * bool -> unit
override this.DrawFocus : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Rectangle * int * System.Windows.Forms.DataGridViewElementStates * System.Windows.Forms.DataGridViewCellStyle * bool -> unit
Protected Friend Overridable Sub DrawFocus (graphics As Graphics, clipBounds As Rectangle, bounds As Rectangle, rowIndex As Integer, rowState As DataGridViewElementStates, cellStyle As DataGridViewCellStyle, cellsPaintSelectionBackground As Boolean)

参数

graphics
Graphics

用于绘制 DataGridViewRowGraphics

clipBounds
Rectangle

Rectangle,它表示需要绘制的 DataGridView 区域。

bounds
Rectangle

一个 Rectangle,包含正在绘制的 DataGridViewRow 的边界。

rowIndex
Int32

当前所绘制的单元格的行索引。

rowState
DataGridViewElementStates

用于指定行的状态的 DataGridViewElementStates 值的按位组合。

cellStyle
DataGridViewCellStyle

用于绘制聚焦框的 DataGridViewCellStyle

cellsPaintSelectionBackground
Boolean

若为 true,则使用 cellStyleSelectionBackColor 属性作为聚焦框的颜色;若为 false,则使用 cellStyleBackColor 属性作为聚焦框的颜色。

例外

行尚未添加到 DataGridView 控件。

graphicsnull

  • 或 - cellStylenull

注解

参数 rowIndex 不在方法的 DrawFocus 基类实现中使用,尽管在派生类中重写此方法时可以使用此参数。

适用于

另请参阅