.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

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -