DataGridViewCell.OnKeyPress(KeyPressEventArgs, Int32) DataGridViewCell.OnKeyPress(KeyPressEventArgs, Int32) DataGridViewCell.OnKeyPress(KeyPressEventArgs, Int32) DataGridViewCell.OnKeyPress(KeyPressEventArgs, Int32) Method

定义

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

参数

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

适用于

另请参阅