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

イベント データを格納している KeyPressEventArgsA 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.

適用対象

こちらもご覧ください