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
Mayur GujrathiPosted Nov 25, 2010, 7:06 AM
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 GujrathiPosted Nov 25, 2010, 7:05 AM
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 GujrathiPosted Nov 25, 2010, 7:02 AM
{
if (e.KeyCode == Keys.Enter)
{
e.Handled = true;
this.ProcessTabKey(!e.Shift);
}
else
{
e.Handled = false;
base.OnKeyUp(e);
}
}
Sam HobbsPosted Nov 22, 2010, 2:26 AM
Jiteendra SampathiraoPosted Nov 22, 2010, 12:25 AM
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.