False keyvalues are passed on keydown event
问题 I have a MDI parent form. When user presses Enter I want the Application to shut down. I check the keydown event as follows: private void MainForm_KeyDown(object sender, KeyEventArgs e) { if (e.KeyValue == (int)Keys.Enter) { Application.Exit(); } } Now it works fine, when I don't have any clickable controls on form (Button, TextBox etc). The e.KeyValue has the (int) value of Enter Key (13). But if I put some buttons or textboxes on to MDI Form, e.KeyValue brings the keyvalue of Alt Key i.e.