WPF win8 tablet mode keyboard hides the item at the bottom of the screen

I am currently using WPF and WIN8 table mode for software development.

In some place you need to enter a certain number using the text field .

I am using some way to finally show the Keyboard: http://brianlagunas.com/showing-windows-8-touch-keyboard-wpf/

But I found, sometimes the Keyboard will cover some element below or in the middle after it appears.

For example: I have 5 text fields on the screen

<Grid> <TextBox HorizontalAlignment="Left" Margin="500,95,0,0" Height="23" Width="120"/> <TextBox HorizontalAlignment="Left" Margin="500,295,0,0" Height="23" Width="120"/> <TextBox HorizontalAlignment="Left" Margin="500,495,0,0" Height="23" Width="120"/> <TextBox HorizontalAlignment="Left" Margin="500,695,0,0" Height="23" Width="120"/> <TextBox HorizontalAlignment="Left" Margin="500,800,0,0" Height="23" Width="120"/> </Grid> 

But now I have found that if the Keyboard focuses on a certain text field not from above, perhaps in the middle or, possibly, at the bottom. The keyboard will cover it. I don’t even see what I’m typing . (As picture)

enter image description here

So, is there a good way to fix it? Thanks.

PS: I'm trying to drag the keyboard, but it doesn't seem like a very good solution, because some text fields are in the middle , the keyboard will still cover what the text field is in the middle.

+6
source share
3 answers

to make this possible you need to do something similar to this.

1) your view should be scrollable (inside scrollviewer)

2) textbox.BringIntoView () usually works, but with the current solution you are using .. it will not be possible because the keyboard display is called after textbox.BringIntoView () ...

See my post on this topic Show and hide Windows 8 on-screen keyboard from WPF

This is the full implementation of showing / hiding the keyboard 8 and auto focus when the text field is focused and you retain all the wpf touch functionality that you lose when you use inkDisableHelper

+3
source

The keyboard can be moved by the user so that it does not close. It’s best to let the user handle the situation this way than try to rebuild Windows.

+3
source

The virtual keyboard should automatically move the focused TextBox into view when the keyboard is displayed. Microsoft says this behavior is automatic, but can be overridden using EnsuredFocusedElementInView ( example here )

I think this can be solved by setting transition Y

  _offSet = 0; Windows.UI.ViewManagement.InputPane.GetForCurrentView().Showing += (s, args) => { _offSet = (int)args.OccludedRect.Height; args.EnsuredFocusedElementInView = true; var trans = new TranslateTransform(); trans.Y = -_offSet; this.RenderTransform = trans; }; Windows.UI.ViewManagement.InputPane.GetForCurrentView().Hiding += (s, args) => { var trans = new TranslateTransform(); trans.Y = 0; this.RenderTransform = trans; args.EnsuredFocusedElementInView = false; }; 

inside the constructor.

You can also take a look at

1) Tips and tricks for C # Metro developers: virtual keyboard processing

2) The popup window remains under the virtual keyboard instead of scrolling the bottom application bar

0
source

All Articles