Hello I’m trying to handle the user’s input to the TextBox in Silverlight. I need to catch the text that’s been entered and if it is not valid dismiss it. I’ve tried processing KeyDown and TextInputStart events, but the text gets updated after them. What should I do?
Share
I think you better use Silverlight Validation with MVVM.
But if you prefer events, you can use the TextChanged Event to get every new character.
You can cast the
senderin order the get theTextBoxand use it’sTextproperty.For example:
(VB.NET code)