I am attempting to manually control traversal of a number of TextBox
es in a (WPF) Window. I am successfully using (this is within a PreviewKeyDown handler):
if(<logic>){((TextBox)e.Source).MoveFocus(newTraversalRequest(FocusNavigationDirection.Next));}
to get the actual input point to the next TextBox, but the caret remains in the original TextBox until I type another character. How can I get it over immediately? I have tried callingnextTextBox.Focus()
and Keyboard.Focus(nextTextBox)
but those don't work.