Textbox enter
I have a requirement give me a idea to do that.
When I enter a value in the text box and press enter I have to display some values in the other text .
Tell me how I have to do this.
Give a idea
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
d g19 pointsPosted Jun 11, 2006, 8:29 AM EDT
Find where it says
//
// textBox1
//
Assuming this is the textbox you want to respond when the user presses 'enter'... now add this line of code with the other textBox1 handlers...
this.textBox1.KeyUp += new System.Windows.Forms.KeyEventHandler(textBox1_KeyUp); Go to your Form1.cs and add the textBox1_KeyUp method: private void textBox1_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode.ToString().Equals("Return")) { // do stuff here, ie: textBox2.Text = "I changed to this when textBox1 received 'enter'"; } }Misko Misic2 pointsPosted Jun 12, 2006, 4:47 AM EDT
d g19 pointsPosted Jun 12, 2006, 5:20 PM EDT
good point, and using the ascii is better