开发者

How do I trigger or supress the display of Windows Virtual Keyboard

开发者 https://www.devze.com 2023-03-23 23:17 出处:网络
In WPF I have a screen for login which has a textbox for username and a password box for password.I ideally need to prevent the on-screen keyboard from displaying so I can use a custom keyboard in the

In WPF I have a screen for login which has a textbox for username and a password box for password. I ideally need to prevent the on-screen keyboard from displaying so I can use a custom keyboard in the perfect location in the app. Failing that I need to somehow force the on-screen keyboard to display for the password box.

I've found the Microsoft.Ink.TextInput.TextInputPanel 开发者_JAVA技巧seems to have most of this functionality in .net 3.5, but I can't find an equivalent in .net 4.0

P.S. Any textboxes on other forms need to work as normal, and other applications on the same tablet should ideally also be unaffected, so I'm uncomfortable with surpressing the TIP using a registry key.


You cannot show / hide the virtual keyboard from .Net managed code. However, as the virtual keyboard is just a standard windows application you can simply show / hide it by starting the appropriate Process.

var virtualKeyboard = new System.Diagnostics.Process();
virtualKeyboard = System.Diagnostics.Process.Start("osk.exe"); // open
virtualKeyboard.Kill(); // close
0

精彩评论

暂无评论...
验证码 换一张
取 消