DataGridViewRow.DrawFocus メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataGridViewRow.DrawFocus メソッドの意味・解説 

DataGridViewRow.DrawFocus メソッド

メモ : このメソッドは、.NET Framework version 2.0 で新しく追加されたものです。

指定した境界の周囲に、フォーカスを表す四角形を描画します。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

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
 _
)
Dim graphics As Graphics
Dim clipBounds As Rectangle
Dim bounds As Rectangle
Dim rowIndex As Integer
Dim rowState As DataGridViewElementStates
Dim cellStyle As DataGridViewCellStyle
Dim cellsPaintSelectionBackground As Boolean

Me.DrawFocus(graphics, clipBounds, bounds, rowIndex, rowState,
 cellStyle, cellsPaintSelectionBackground)
protected internal virtual void DrawFocus (
    Graphics graphics,
    Rectangle clipBounds,
    Rectangle bounds,
    int rowIndex,
    DataGridViewElementStates rowState,
    DataGridViewCellStyle cellStyle,
    bool cellsPaintSelectionBackground
)
protected public:
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
)

パラメータ

graphics

DataGridViewRow の描画に使用する Graphics。

clipBounds

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

bounds

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

rowIndex

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

rowState

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

cellStyle

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

cellsPaintSelectionBackground

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

例外例外
例外の種類条件

InvalidOperationException

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

ArgumentNullException

graphics が null 参照 (Visual Basic では Nothing) です。

または

cellStyle が null 参照 (Visual Basic では Nothing) です。

解説解説

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

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

DataGridViewRow.DrawFocus メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DataGridViewRow.DrawFocus メソッドのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS