DataGridView.SetSelectedCellCore(Int32, Int32, Boolean) メソッド

定義

指定された行インデックスおよび列インデックスを持つセルの選択状態を変更します。

protected:
 virtual void SetSelectedCellCore(int columnIndex, int rowIndex, bool selected);
protected virtual void SetSelectedCellCore (int columnIndex, int rowIndex, bool selected);
abstract member SetSelectedCellCore : int * int * bool -> unit
override this.SetSelectedCellCore : int * int * bool -> unit
Protected Overridable Sub SetSelectedCellCore (columnIndex As Integer, rowIndex As Integer, selected As Boolean)

パラメーター

columnIndex
Int32

セルを含む列のインデックス。

rowIndex
Int32

セルを含む行のインデックス。

selected
Boolean

セルを選択する場合は true。セルの選択を解除する場合は false

例外

columnIndex が、0 未満か、コントロール内の列数から 1 を引いた値を超えています。

- または -

rowIndex が、0 未満か、コントロール内の行数から 1 を引いた値を超えています。

注釈

コントロールは、セルの DataGridView 選択状態を変更するたびに、このメソッドを使用します。 選択状態は、現在 SelectionMode のプロパティ値に関係なく、プロパティ値を変更せずに変更されます CurrentCell 。 これは、独自の選択モードを実装する場合に便利です。

適用対象

こちらもご覧ください