Windows 7上带触摸的WPF:隐藏软键盘(以及启用它的弹出图标)

时间:2020-11-29 10:16:35

I have a WPF application that, due to hardware constraints, has to run on Windows 7 Standard Embedded. The device is touch enabled and I am taking advantage of that in the way that I am building the application.

我有一个WPF应用程序,由于硬件限制,必须在Windows 7 Standard Embedded上运行。该设备是触摸启用的,我正在利用这一点,我正在构建应用程序。

One problem I have however is that when I use a TextBox control (which to be honest is not very often) the user is presented with an icon when the control has focus that allows the opening of an on-screen keyboard - this icon being provided by WPF and/or the OS, not something that I am doing myself.

然而,我遇到的一个问题是,当我使用TextBox控件时(说实话并不常见),当控件具有允许打开屏幕键盘的焦点时,会向用户显示一个图标 - 提供此图标通过WPF和/或操作系统,而不是我自己做的事情。

I would like to be able to disable this icon and the associated keyboard either at an individual form level or at an individual control level but all searches return results assuming that I want to try and enable such functionality and/or replicate it.

我希望能够在单个表单级别或单个控件级别禁用此图标和关联键盘,但所有搜索都返回结果,假设我想尝试启用此类功能和/或复制它。

Can anybody please advise as to how I can control the availability of the Windows 7 on screen keyboard within a WPF application so that I can indeed disable it?

任何人都可以告诉我如何在WPF应用程序中控制Windows 7屏幕键盘的可用性,以便我确实可以禁用它?

I should also point out that the hardware constraints currently rule out any option of upgrading to Windows 8, 8.1 or 10 so please do not consider this in any answer you may have.

我还应该指出,硬件限制目前排除了升级到Windows 8,8.1或10的任何选项,所以请不要在任何答案中考虑这一点。

Thanks.

谢谢。

1 个解决方案

#1


0  

To disable the on screen keyboard icon for a TextBox, set InputMethod.IsInputMethodEnabled="False" against it in the Xaml.

要禁用TextBox的屏幕键盘图标,请在Xaml中对其设置InputMethod.IsInputMethodEnabled =“False”。

Have not yet tested at any other level, but this solved my problem.

尚未在任何其他级别进行测试,但这解决了我的问题。

#1


0  

To disable the on screen keyboard icon for a TextBox, set InputMethod.IsInputMethodEnabled="False" against it in the Xaml.

要禁用TextBox的屏幕键盘图标,请在Xaml中对其设置InputMethod.IsInputMethodEnabled =“False”。

Have not yet tested at any other level, but this solved my problem.

尚未在任何其他级别进行测试,但这解决了我的问题。