.net - How do I simulate Text input to a WPF TextBox? -
I want to simulate user input in a WPF TextBox. I want to input a character like the OnPreviewTextInput event is triggered. I tried to set text through text property, but it did not trigger the event:
public zeros some functions () {var textbox = new textbox (); text box. Text = "A"; }
Can I trigger the event clearly?
See answer for a good description of the simulation of input events
You can also:
Text Composition Manager. Start composition (new text composition (present manager, text box, "A"));
This will increase the PreviewTextInput event and then will increase the TextInput event and change the text.
Comments
Post a Comment