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

DataGridViewRow の描画に使用する Graphics

clipBounds
Rectangle

描画が必要な DataGridView の領域を表す Rectangle

bounds
Rectangle

描画される DataGridViewRow の境界が格納された Rectangle

rowIndex
Int32

描画されるセルの行インデックス。

rowState
DataGridViewElementStates

行の状態を指定する DataGridViewElementStates 値のビットごとの組み合わせ。

cellStyle
DataGridViewCellStyle

フォーカスを表す四角形の描画に使用する DataGridViewCellStyle

cellsPaintSelectionBackground
Boolean

フォーカスを表す四角形の色として、cellStyleSelectionBackColor プロパティを使用する場合は true。フォーカスを表す四角形の色として、cellStyleBackColor プロパティを使用する場合は false

例外

行が DataGridView コントロールに追加されていません。

graphicsnullです。

または cellStylenullです。

注釈

この rowIndex パラメーターは、メソッドの基底クラス実装 DrawFocus では使用されませんが、派生クラスでこのメソッドをオーバーライドするときに使用できます。

適用対象

こちらもご覧ください