共用方式為


DataGridViewRow.DataGridViewRowAccessibleObject.Select 方法

定義

修改選取或者移動可存取物件的鍵盤焦點。

public:
 override void Select(System::Windows::Forms::AccessibleSelection flags);
public override void Select (System.Windows.Forms.AccessibleSelection flags);
override this.Select : System.Windows.Forms.AccessibleSelection -> unit
Public Overrides Sub Select (flags As AccessibleSelection)

參數

flags
AccessibleSelection

其中一個 AccessibleSelection 值。

例外狀況

Owner 屬性的值是 null

備註

下表描述方法將針對每個 flags 值執行的動作 Select

參數值 動作
TakeFocus DataGridView 取得焦點。
TakeSelection 資料列中的 會 DataGridViewCell 取得焦點。
AddSelection DataGridViewCell 加入 至 SelectedCells 屬性。
RemoveSelection DataGridViewCellSelectedCells 屬性中移除 。

當您指定 TakeSelection 值時,目前具有焦點的 DataGridViewCell 資料行與將取得目前 DataGridViewRow 焦點的儲存格相同。 例如,如果第 10 列,儲存格 3 有焦點,而您為第 15 列指定 TakeSelection ,則第 15 列,儲存格 3 會有焦點。 如果 中沒有 DataGridViewCell DataGridView 焦點,則資料列中的第一個儲存格會取得焦點。

適用於

另請參閱