Quantcast
Viewing all articles
Browse latest Browse all 18858

Move caret after a MoveFocus() call

I am attempting to manually control traversal of a number of TextBoxes 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.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>