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

前端 未结 2 972
庸人自扰
庸人自扰 2020-12-20 20:41

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 a

2条回答
  •  别那么骄傲
    2020-12-20 21:04

    You can use a "brute force" method - the text box (in winforms and I think in WPF as well) has a text changed event you can use and by comparing the text before the event and the current text you can find what character has been added or removed.

提交回复
热议问题