For our WPF application, when it runs on touch screen(Surface Pro .etc), the TextBox
/PasswordBox
control cannot show virtual keyboard when they get focused.
Any good way to implement this feature in WPF?
Updated:
what we want to achieve finally is something like that:
If user run app on PC, we don't care about this feature, which means whether user has physical keyboard, we do nothing just like normal WPF application running on PC.
If user run on Surface Pro, when he clicks the TextBox
, the built-in virtual keyboard can show up, and which should be user-friendly, such as the keyboard would never cover up the input element.
Updated 2:
So, WPF cannot easily set some property to implement this feature? In my opinion, this feature should be built-in WPF, I don't understand why I cannot find an easy way to achieve.
I saw this done in a TechEd session, you need to first disable Inking support (DisableWPFTabletSupport) then you can create an InputPanelConfiguration (AutomationElement.FromHandle(new WindowsInteropHelper(this).Handle) and call EnableFocusTracking.
DisableWPFTabletSupport: http://msdn.microsoft.com/en-us/library/ee230087.aspx
EnableFocusTracking: http://msdn.microsoft.com/en-us/library/windows/desktop/jj126268(v=vs.85).aspx
When targeting
.Net 4.6.2
+ you don't need to do anything:https://riptutorial.com/wpf/example/23104/showing-touch-keyboard-on-windows-8-and-windows-10