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.
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.
FroglegPosted Oct 14, 2013, 7:01 AM
Vinek ChembakasseryPosted Oct 14, 2013, 6:56 AM
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
FroglegPosted Oct 14, 2013, 6:17 AM
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 ChembakasseryPosted Oct 14, 2013, 6:00 AM
FroglegPosted Oct 14, 2013, 5:51 AM
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if(e.KeyCode== Keys.Enter)
{
textBox2.Focus();
}
}