Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Home » Tip Bank » .NET » C#
Language: .NET
Expertise: Beginner
Jun 8, 2017

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;
            }
        }
Hannes du Preez
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date