DataGridViewCell.OnKeyPress(KeyPressEventArgs, Int32) 方法

定义

在焦点位于单元格上并同时按任意键时进行调用。Called when a key is pressed while the focus is on a cell.

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

参数

e
KeyPressEventArgs

包含事件数据的 KeyPressEventArgsA KeyPressEventArgs that contains the event data.

rowIndex
Int32

该单元格的父行索引。The index of the cell's parent row.

注解

此方法类似于 Control.OnKeyPress 方法。This method is similar to the Control.OnKeyPress method. 在引发事件的相同情况下,它会被调用 KeyPress ,但实际上不会引发事件。It is called in the same circumstances in which a KeyPress event is raised, but it does not actually raise the event.

适用于

另请参阅