How can I forbid the Backspace-Key as easy as possible in a WPF-Application?
The KeyDown-Event don’t catch at the DEL and the Backspace-Key.
Thank you!
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.
To handle Backspace or other pressed key in order to cancel it, try to use the “PreviewKeyDown” event handler.
In your Xaml, set the attribute PreviewKeyDown like this :
and in your code, define the event handler like this :
Hop that helps 🙂