DataGridViewCell.OnKeyDown(KeyEventArgs, Int32) 方法

定义

在焦点位于单元格上并同时按下字符键时进行调用。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

包含事件数据的 KeyEventArgsA KeyEventArgs that contains the event data.

rowIndex
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.

适用于

另请参阅