1 year ago
#268191
Guy Lowe
Touch keyboard not appearing in WinUI 3 app
I have a touch application that was originally written using the UWP framework and I've not ported it to WinUI3. Everything has gone well so far but when I use a TextBox and click on it the touch Windows keyboard doesn't appear.
After lots of experimentation I decided to try out the template that comes with VS 2022 for a packaged WinUI3 app. This app is very simple and I thought this would be a good starting point to figure out what I am doing wrong. Out of the box it just has a button that when clicked changes its text to "Clicked". This works fine. I then add a TextBox to the app and when I click it no keyboard comes up.
What I do know;
- When I use other apps on the pc and click into a text box the keyboard comes up. For example, when pressing on Windows search, or when I use Edge and do a search it appears. It also appears when using VS.
- There is no physical keyboard attached.
- The device is in Tablet mode.
So there is nothing in the OS that seems to be the problem and the VS template doesn't work out of the box either.
I'm loathe to think this is a bug in WinUI3 as it seems fundamental.
Here is the template code:
<Window
x:Class="TextBoxTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:TextBoxTest"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button x:Name="myButton" Click="myButton_Click">Click Me</Button>
<TextBox Width="200" Height="200"></TextBox>
</StackPanel>
</Window>
Any help would be appreciated.
c#
xaml
tablet
winui-3
0 Answers
Your Answer