Automatically pop up tablet touch keyboard on WinForms input focus

The root cause seems to be that Winforms’ textBox is not an AutomationElement, while the rest of the mentioned controls (ComboBoxes etc) are.

Quoting Markus von und zu Heber’s accepted answer here:

We found it in the article “Automatic Touch Keyboard for TextBoxes in
WPF Applications on Windows 8+
“, but it also works very good (and even
easier!) for winforms. Thank you, Dmitry Lyalin!

  1. Insert a reference to UIAutomationClient.dll to your project

  2. In the form-load-handler of the application’s main window, insert the following code:

    var asForm = System.Windows.Automation.AutomationElement.FromHandle(this.Handle);
    

Leave a Comment