Determine when and which character is added or deleted in a Text Box.

Posted by Alon on Stack Overflow See other posts from Stack Overflow or by Alon
Published on 2010-04-04T15:39:58Z Indexed on 2010/04/04 15:53 UTC
Read the original article Hit count: 268

Filed under:
|
|
|

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 to use 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 determite which character was added (from the KeyEventArgs).

Any ideas?

I don't care to use a completely different solution from what I thought. In addition, I've just started this project so I don't care to use Windows Forms instead of WPF if your solution requires it.

Thank you.

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf