Dear Friends
I want to make such a functionality in my project that user can move between controls on enter click rather than tab key. Please give me few lines of coding considering that there are 5 text boxes on form and want move between them on enter click
Loading

Jiteendra SampathiraoRank #585 · 4.1K reputationPosted Nov 21, 2010, 7:25 PM EST
write Javascript to achieve that. Write OnFocus().
If this post helped you, then tick the "Do you like this Answer" checkbox which is placed at above this post.
Sam HobbsRank #107 · 20.5K reputationPosted Nov 21, 2010, 9:26 PM EST
Mayur Gujrathi85 reputationPosted Nov 25, 2010, 2:02 AM EST
{
if (e.KeyCode == Keys.Enter)
{
e.Handled = true;
this.ProcessTabKey(!e.Shift);
}
else
{
e.Handled = false;
base.OnKeyUp(e);
}
}
Mayur Gujrathi85 reputationPosted Nov 25, 2010, 2:05 AM EST
protected override void OnKeyUp(System.Windows.Forms.KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
e.Handled = true;
this.ProcessTabKey(!e.Shift);
}
else
{
e.Handled = false;
base.OnKeyUp(e);
}
}
But I have yet another problem that above code successfully runs on windows forms but In my project I have used User controls Instead of forms And I am getting user controls on forms. Now the above code is not running successfully on user controls
please help
Mayur Gujrathi85 reputationPosted Nov 25, 2010, 2:06 AM EST
protected override void OnKeyUp(System.Windows.Forms.KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
e.Handled = true;
this.ProcessTabKey(!e.Shift);
}
else
{
e.Handled = false;
base.OnKeyUp(e);
}
}
But I have yet another problem that above code successfully runs on windows forms but In my project I have used User controls Instead of forms And I am getting user controls on forms. Now the above code is not running successfully on user controls
please help