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)

參數

e
KeyPressEventArgs KeyPressEventArgs KeyPressEventArgs KeyPressEventArgs

KeyPressEventArgs,其中包含事件資料。A KeyPressEventArgs that contains the event data.

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.

適用於

另請參閱