private void UserControl_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Return)
            {
                if (TextBoxNumber.IsKeyboardFocused)
                {
                    Keyboard.Focus(TextBoxSymbol);
                    TextBoxSymbol.SelectAll();
                }
                else if (TextBoxSymbol.IsKeyboardFocused)
                {
                    Keyboard.Focus(TextBoxDescription);
                    TextBoxDescription.SelectAll();
                }
                else if (TextBoxDescription.IsKeyboardFocused)
                {
                    Keyboard.Focus(TextBoxNumber);
                    TextBoxNumber.SelectAll();
                }

                if (Keyboard.Modifiers == ModifierKeys.Shift)
                {
                    RaiseEvent(new RoutedEventArgs(EntryCompleteEvent, this));
                }
            }
        }
Example #2
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     TextBoxDescription.Focus();
     TextBoxDescription.SelectAll();
 }