On a wpf TextBox
that has an TextChanged
event, it seems to only fires when focus is taken away from the textbox; but not as individual characters are typed in.
Is there an event similar to TextChanged
that fires immediately when a character is typed into the textbox, rather than when focus changes?
Remarks. The TextChanged event is raised when the content of the text box changes between posts to the server. The event is only raised if the text is changed by the user; the event is not raised if the text is changed programmatically.
The event handler is called whenever the contents of the TextBox control are changed, either by a user or programmatically. This event fires when the TextBox control is created and initially populated with text.
The TextChanged event occurs whenever the text is changed, by the user or programmatically. In your case your A_TextChanged eventhandler is changing B's text, so that B_TextChanged is called … Adding some Debug.
You can bind the Text
property and make use of the UpdateSourceTrigger.
UpdateSourceTrigger=PropertyChanged
By setting it to PropertyChanged
, you will get a notification each and every time the text changes.
TextChanged
does fire as soon as the text is changed.
(If you have a binding on Text
that is not the same thing, it is completely independent from the event.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With