Is there any way to define a style/trigger/template that will cause a textbox to lose focus once the Enter key is pressed? Preferably, without using any code…
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, there’s nothing baked into WPF to do that. You’d have to add some sort of custom code to look for the Enter key and move the focus manually.
The easiest way would be to use an attached behavior. You could then turn this feature on for all or some of the TextBoxes.