I believe there are two methods to accomplish this, would just involve adding:
Option 1: Grabbing the Next Control if an Enter KeyPress was performed
In the properties of your form, set the KeyPreview property of the form to true
.
The code below will capture your "Enter-Press" event and perform the logic that you are looking for:
private void [YourFormName]_KeyDown(object sender, KeyEventArgs e)
{
Control nextControl ;
//Checks if the Enter Key was Pressed
if (e.KeyCode == Keys.Enter)
{
//If so, it gets the next control and applies the focus to it
nextControl = GetNextControl(ActiveControl, !e.Shift);
if (nextControl == null)
{
nextControl = GetNextControl(null, true);
}
nextControl.Focus();
//Finally - it suppresses the Enter Key
e.SuppressKeyPress = true;
}
}
This actually allows for the user to press "Shift+Enter" to go to the proceeding tab as well.
Option 2: Using the SendKeys method
private void [YourFormName]_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
SendKeys.Send("{TAB}");
}
}
I am not sure if this method is still commonly used or may be considered a "hack"? I would recommend the first one, but I believe both should work for your needs.