Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF win8 tablet mode the keyboard hide the item on the bottom of the screen

Tags:

c#

wpf

.net-4.0

I'm currently use WPF and WIN8 table mode design some software.

There is some place need input some number use Textbox.

I use 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 item on the bottom or middle after it show up.

For example: I have 5 Textbox 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 found if the Keyboard get focus on some Textbox not on the top, Maybe on the middle or maybe on the bottom. The Keyboard will cover it. I even can't see what I am typing in.(Like the Picture)

enter image description here

So Is there any good way to fix it ? Thank you.

PS: I've try to drag the Keyboard, but Looks like it's not a good solution, because some Textbox on the middle, Keyboard will still cover which Textbox on the middle.

like image 808
qakmak Avatar asked Aug 01 '15 16:08

qakmak


2 Answers

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

1) your view must be scrollable (inside a scrollviewer)

2) textbox.BringIntoView() would normally work, but with the current solution you are using.. it won't be possible because the keyboard show is called after textbox.BringIntoView()...

See my post in this thread Show & hiding the Windows 8 on screen keyboard from WPF

It's a complete implementation of showing/hiding the win 8 keyboard and auto focus when the textbox is focused and you keep all the wpf touch functionality that you lose when you are using inkDisableHelper

like image 159
Guillaume Avatar answered Oct 12 '22 07:10

Guillaume


The keyboard can be moved used by the user so that it is not covering. Its best to let the user handle the situation this way than try to re-engineer the Windows experience

like image 3
Glen Thomas Avatar answered Oct 12 '22 07:10

Glen Thomas