Thursday, 15 February 2018

Enter Key works as Tab in c# windows application

Hi Friends,

     Here i am going to show you when ever a user clicks on enter button which should have to work as tab. That is when  a user enters data in some text box and press enter button then the cursor should jump to next text box. To work with this set the property keypreview=true for the form and write a event for the form under keydown event



private void Form1_KeyDown(object sender, KeyEventArgs e)
{
            if (e.KeyCode == Keys.Enter)
            {
                SendKeys.Send("{TAB}");
            }
 }


Thank you.

No comments:

Post a Comment