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

包含事件数据的 KeyEventArgsA 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.

适用于

另请参阅