+ Reply to Thread
Results 1 to 2 of 2

Thread: Press TAB the programming way

  1. #1

    Press TAB the programming way

    Hi , i am creating a simple WPF application and i got a tab control with some tabs on it and i`d like when user press ENTER , it press TAB , hope you got me , so far i tried that :
    Code:
    private void userPressEnter(object sender, KeyEventArgs e)
    {
      if (e.Key == Key.Return)
      {
        e.Key = Key.Tab
      }
    }
    But it is not working !

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    45
    There is a method that can focus on the next it can find and here it is :
    Code:
    private void userPressEnter(object sender, KeyEventArgs e)
    {
     if (e.Key == Key.Return)
     {
       TraversalRequest request = new TraversalRequest(FocusNavigationDirection.Next);
       MoveFocus(request);
     }
    }

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts