WPF on Windows 7 with touch: hide soft keyboard (and the popup icon that enables it)

橙三吉。 提交于 2019-12-12 03:46:43

问题


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.

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.

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?

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.

Thanks.


回答1:


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

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



来源:https://stackoverflow.com/questions/37596526/wpf-on-windows-7-with-touch-hide-soft-keyboard-and-the-popup-icon-that-enables

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!