Plz send me the code for select the next text box when pressing on the ENTER KEY in windows forms
..............
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
FroglegRank #1,020 · 1.9K reputationPosted Oct 14, 2013, 1:51 AM EDT
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if(e.KeyCode== Keys.Enter)
{
textBox2.Focus();
}
}
Vinek Chembakassery15 reputationPosted Oct 14, 2013, 2:00 AM EDT
FroglegRank #1,020 · 1.9K reputationPosted Oct 14, 2013, 2:17 AM EDT
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
textBox2.Focus();
}
}
private void textBox2_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
textBox3.Focus();
}
}
private void textBox3_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
textBox1.Focus();
}
}
how many do you think you will need ?
Vinek Chembakassery15 reputationPosted Oct 14, 2013, 2:56 AM EDT
if (e.KeyData == Keys.Enter)
{
if (this.GetNextControl(ActiveControl, true) != null)
{
e.Handled = true;
this.GetNextControl(ActiveControl, true).Focus();
}
}
i got it
this is the easy way..........ur ansr is vry risk...any way tks
FroglegRank #1,020 · 1.9K reputationPosted Oct 14, 2013, 3:01 AM EDT