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


advertisement
 

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

Here's what to do in the case of needing the Enter key to operate as the Tab key.


advertisement

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;
            }
        }

 

Visit the DevX Tip Bank

 





   
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