How do I keep focus on TextBox after a button was pushed?
I have a X开发者_如何学运维AML ListBox, a TextBox inside the ItemTemplate. A user edits text inside the TextBox, and then presses a button in the application bar. How do I keep the focus on the TextBox after the button in the application bar was pushed?
You don't. You set it back afterwards.
You can use Focus()
method to do this.
You can also use the SelectionStart
and SelectionLength
to highlight a specific part of the text.
精彩评论