devxlogo

Using the Enter Key to Navigate to the Next Control in C#

Using the Enter Key to Navigate to the Next Control in C#

There are cases in which you would need the Enter key to operate as the Tab key. In order for the Enter key to be used as a Tab key, you could use code similar to the following:

private void Text1_KeyPress(object sender, KeyPressEventArgs e)        {            if (e.KeyChar == 13) //Determine Enter            {                SendKeys.Send("{TAB}"); //???Fake??? Tab press                e.Handled = true;            }        }

devx-admin

Share the Post: