i want to develop typing tutor application for kids
but there are proble how to handle key from key board
like enter key and other inputs
Typing tutor sample c# + xaml
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Shweta LodhaRank #31 · 39.8K reputationPosted Feb 3, 2014, 10:10 AM EST
private void Form1_Load(object sender, System.EventArgs e) { // Set these when the form loads: // Have the form capture keyboard events first. this.KeyPreview = true; // Assign the event handler to the form. this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown); // Assign the event handler to the text box. this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown); } private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.Alt && e.KeyCode.ToString() == "F") { // When the user presses both the 'Alt' key and 'F' key, // KeyPreview is set to False, and a message appears. // This message is only displayed when KeyPreview is set to True. this.KeyPreview = false; MessageBox.Show("KeyPreview is True, and this is from the FORM."); } } private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (e.Alt && e.KeyCode.ToString() == "F") { // When the user presses both the 'Alt' key and 'F' key, // KeyPreview is set to False, and a message appears. // This message is only displayed when KeyPreview is set to False. this.KeyPreview = true; MessageBox.Show("KeyPreview is False, and this is from the CONTROL."); } }