DataGridView.SetSelectedCellCore(Int32, Int32, Boolean) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
變更具有指定資料列和資料行索引之儲存格的選取狀態。
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
則表示取消選取儲存格。
例外狀況
備註
每當控制項變更儲存格的選取狀態時,控制項 DataGridView 就會使用這個方法。 選取狀態會變更,而不考慮目前的 SelectionMode 屬性值,而且不會變更 CurrentCell 屬性值。 當您想要實作自己的選取模式時,這會很有用。
適用於
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應