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)); } } }
public void BeginEdit() { Keyboard.Focus(TextBoxNumber); TextBoxNumber.SelectAll(); }