[ACCEPTED]-WPF: Textbox not firing onTextInput event-textinput
Accepted answer
Your handler for the TextInput
event is not fired 4 because the TextBox
is handling the event. You 3 could try using the TextChanged event instead, since 2 really you just want to know when characters 1 were added or removed from the TextBox
.
InitializeComponent();
textbox.AddHandler(TextBox.TextInputEvent,
new TextCompositionEventHandler(TextBox_TextInput_1),
true);
0
Use "PreviewTextInput" instead, it will 1 work.
Create a new class derived from TextBox. In 3 the new class override the OnTextInput method. Your 2 OnTextInput method will get called before 1 the TextBox gets it.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.