You could automatically open the Touch keyboard by starting taptix.exe. You can try to refer to the following code.
The code of MainWindow.xaml is as follows:
<local:NewTextBox Width="100" Height="30" Background="LightGreen" ></local:NewTextBox>
The code of NewTextBox is as follows:
public class NewTextBox : TextBox
{
public NewTextBox()
{
this.GotFocus += TextBox_GotFocus;
}
private void TextBox_GotFocus(object sender, RoutedEventArgs e)
{
RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\TabletTip\\1.7");
registryKey?.SetValue("KeyboardLayoutPreference", 0, RegistryValueKind.DWord);
registryKey?.SetValue("LastUsedModalityWasHandwriting", 1, RegistryValueKind.DWord);
Process.Start(@"C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe");
}
}
The result is shown in the figure:
Hi @Hui Liu-MSFT . I am developing my product on a computer for tablet use (using Tablet mode). Yes I want the touch keyboard to popup automatically when I click the NewTextBox control.