I have a simple text box in a WPF application.
I need to know when a character was added/deleted in the text box, which character and where it was added or deleted.
I thought about using the TextBox.KeyDown event, but it has some problems:
- I can’t know where the character was added or deleted.
- I have no idea how to determine which character was added (from the
KeyEventArgs).
Any ideas?
Found the solution. In WPF, the
TextBox.TextChangedevent has aTextChangedEventArgs. In this class, there is a property namedChanges.Here’s my code:
Now I just need to wait two days to accept this answer. 🙂
Thanks anyway.