DataGridViewCell.OnKeyPress(KeyPressEventArgs, Int32) 方法

定義

當焦點在儲存格上,按下按鍵時呼叫。

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

KeyPressEventArgs,其中包含事件資料。

rowIndex
Int32

儲存格的父資料列索引。

備註

這個方法類似于 Control.OnKeyPress 方法。 它會在引發事件的相同情況下 KeyPress 呼叫,但實際上不會引發事件。

適用於

另請參閱