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
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
d gPosted Jun 12, 2006, 9:20 PM
good point, and using the ascii is better
Misko MisicPosted Jun 12, 2006, 8:47 AM
d gPosted Jun 11, 2006, 12:29 PM
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'";
}
}