c# - Why does the KeyDown Event Not Work? -


Below is my complete code, there is no other form, classes etc., which can interfere with the code. It was written early. Note that I know that I

  this.KeyPreview = true;  

Two times, that's because I saw it in both places while viewing the example code code is not compiled with errors I also use this text box as a non-functional result Have tried to experiment with.

E. Kcode == key.enter is a code that does not work. I also tried other keys like W and A. Does anyone know what I need to do? Using VS2010

  Using the system; Using System.Collections.Generic; Using System.ComponentModel; Using System.Data; Using System.Drawing; Using System.Linq; Using System.Text; Using System.Windows.Forms; Namespace WindowsFormsApplication5 {Public Partial Category Form 1: Form {Public Form 1 () {InitializeComponent (); this. KPV = True; } Private Zero form1_load (object sender, eventAgds E) {this.KeyPreview = true; } Private Zero Form 1_CodeDown (Object Sender, Key EventAgages E) {if (e.KeyCode == Keys.Enter) {MessageBox.Show ("True"); }}}}}  

set isInputKey property true .


Comments