How can I restrict TextBox to accept only capital letters, or for example digits, or forbid to put any special character?
Sure it's a piece of cake to catch TextInput event and handle the text here, but is it the proper way to do this?
input-filteringmasktextboxwpfwpf-controls
How can I restrict TextBox to accept only capital letters, or for example digits, or forbid to put any special character?
Sure it's a piece of cake to catch TextInput event and handle the text here, but is it the proper way to do this?
Best Solution
I've done this in the past with an attached behavior, which can be used like this:
The attached behavior code looks like this: