Move to next textbox when Enter key is pressed
Its Simple
follow this code..
Paste this code in KeyUp event of Your Control
if ((e.KeyCode == Keys.Enter) || (e.KeyCode == Keys.Return))
{
this.SelectNextControl((Control)sender, true, true, true, true);
}
Example..
private void txtcodefrom_KeyUp(object sender, KeyEventArgs e)
{
if ((e.KeyCode == Keys.Enter) || (e.KeyCode == Keys.Return))
{
this.SelectNextControl((Control)sender, true, true, true, true);
}
}
OTHER WAY.
private void txtTAX_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
SendKeys.Send("{TAB}");
e.Handled = true;
e.SuppressKeyPress = true;
}
}
No comments:
Post a Comment