14
votes

We started creating a WPF touch application in Windows 8 and recently migrated to Windows 10. One feature we implemented is opening the Windows Keyboard when a TextBox receives focus. In Windows 8, it was possible to dock the keyboard to the bottom by setting the registry setting EdgeTargetDockedState and starting the TabTip process:

     string path =  @"C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe";
     var info = new ProcessStartInfo(path);
     info.WindowStyle = ProcessWindowStyle.Maximized;
     var p = new Process();
     p.StartInfo = info;
     p.Start();

The Windows 10 keyboard however doesn't seem to have the same dock behavior as in Windows 8. The keyboard now overlays any maximized window which hides the bottom part of any application. Only not-maximized windows are resized to fit the remaining space.

I've checked the following links, but found no solution:

Can the Windows 10 keyboard be docked programmatically for a maximized window?

3
Have you found a solution?nicruo
As far as I know, the keyboard in Windows 10 cannot be docked when the window is maximized. I have asked in the Microsoft link where this feature can be officially requested, but have not received a satisfactory answer. If this won't be implemented, I guess I'll have to look at 'almost maximizing' the window and then opening the keyboard (which seems like a very ugly solution).Bruno V

3 Answers

5
votes

I open-sourced my project to automate everything concerning TabTip integration in WPF app.

You can get it on nuget, and after that all you need is a simple config in your apps startup logic:

TabTipAutomation.BindTo<TextBox>();

You can bind TabTip automation logic to any UIElement. Virtual Keyboard will open when any such element will get focus, and it will close when element will lose focus. Not only that, but TabTipAutomation will move UIElement (or Window) into view, so that TabTip will not block focused element.

For more info refer to the project site.

To clarify: If you will be using this package TabTip will not be docked, but your UI will be in view, which i guess is what you wanted to achieve.

2
votes

Check this article: http://www.codeproject.com/Tips/1120263/Virtual-Keyboard-TabTip-integration-in-WPF-on-Win

Virtual Keyboard will open when any such element will get focus, and it will close when element will lose focus.

0
votes

EDIT: In the case when WindowStyle is set to None, please check out my answer here. Also for manually handling touch keyboard appearance events, check out the sample code here.

The answers here are quite old, currently the touch keyboard works just fine when tapping any textbox, even if the window is maximized.

I recommend targeting at least .NET 4.6.2 to get the best support for touch keyboards in Windows 10, due to a bug in WPF that was fixed in that version. Read more here, scroll down to WPF section.

The only thing you'll have to do is design your XAML in a way that your user interface can react properly when the touch keyboard shows up. Usually putting your content inside a ScrollViewer like so should be enough:

<ScrollViewer PanningMode="VerticalOnly"
              VerticalScrollBarVisibility="Hidden" 
              HorizontalScrollBarVisibility="Disabled"
    <!--Content here-->
</ScrollViewer>

But for more advanced scenarios, like moving buttons that are at the bottom to above the keyboard, you'll need to write your XAML inside the ScrollViewer more carefully, for example by using grids with dynamic heights.

Hope this helps!