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 **
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.