Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Commented Unassigned: RichTextBox.TextChanged fires 6 times [20188]

$
0
0
Hello,

When I am using the `RichTextBox` control and attach the `TextChanged` event, if I make changes directly in the frontoffice, the event is fired 1 time for each change, but if I set the text in code like ```_myBox.text = "test"; ``` the event is fired 6 times.

Has this happened to anyone? Can you suggest a solution?


Thanks in advance.
Comments: ** Comment from web user: josemartins **

My workaround for this was the following:

```
string _captionText = String.Empty;
textBox.TextChanged += delegate {
// To capture only one text changed fire event
// of the total 6 that are fired
if(_captionText != textBox.Text) {
_captionText = textBox.Text;
// Do something;
}
};
```
It's not prettiest of solutions, but it works for me.


Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>