DataGridViewCheckBoxCell.OnKeyDown(KeyEventArgs, Int32) 方法

定義

當焦點在儲存格上,按下字元鍵時即會呼叫。Called when a character key is pressed while the focus is on a cell.

protected:
 override void OnKeyDown(System::Windows::Forms::KeyEventArgs ^ e, int rowIndex);
protected override void OnKeyDown (System.Windows.Forms.KeyEventArgs e, int rowIndex);
override this.OnKeyDown : System.Windows.Forms.KeyEventArgs * int -> unit
Protected Overrides Sub OnKeyDown (e As KeyEventArgs, rowIndex As Integer)

參數

e
KeyEventArgs

KeyEventArgs,包含事件資料。A KeyEventArgs that contains the event data

rowIndex
Int32

目前儲存格的資料列索引,如果儲存格不屬於資料列,則為 -1。The row index of the current cell, or -1 if the cell is not owned by a row.

備註

由空間索引鍵啟動時,此方法會讓儲存格的使用者介面 (UI) 更新。When activated by the space key, this method causes the cell's user interface (UI) to be updated.

這個方法類似于 Control.OnKeyDown 方法。This method is similar to the Control.OnKeyDown method. 它是在引發事件的相同情況下呼叫的 Control.KeyDown ,但實際上並不會引發事件。It is called in the same circumstances in which a Control.KeyDown event is raised, but it does not actually raise the event.

適用於

另請參閱