DataGridViewCell.OnKeyDown(KeyEventArgs, Int32) DataGridViewCell.OnKeyDown(KeyEventArgs, Int32) DataGridViewCell.OnKeyDown(KeyEventArgs, Int32) DataGridViewCell.OnKeyDown(KeyEventArgs, Int32) Method

定義

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

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

參數

e
KeyEventArgs KeyEventArgs KeyEventArgs KeyEventArgs

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

rowIndex
Int32 Int32 Int32 Int32

儲存格的父資料列索引。The index of the cell's parent row.

備註

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

適用於

另請參閱