使用 C# 中的按钮调用屏幕键盘

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8800212/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-09 04:30:07  来源:igfitidea点击:

Calling the on-screen keyboard using a button in C#

c#.netemgucvon-screen-keyboard

提问by ykombinator

I am creating a windows application using C#, where in a button on the GUI when clicked, should display the on-screen keyboard.

我正在使用 C# 创建一个 Windows 应用程序,单击 GUI 上的按钮时,应显示屏幕键盘。

Would appreciate if any help is granted. thanks.

如果获得任何帮助,将不胜感激。谢谢。

Also, since I am mostly using Emgu Cv library for the rest of my app, Can we simply use it for calling the On-screen keyboard?

另外,由于我在应用程序的其余部分主要使用 Emgu Cv 库,我们可以简单地使用它来调用屏幕键盘吗?

采纳答案by Jits

In C#, you can simply write the following line of code to invoke the on-screen keyboard application that comes with Windows:

在 C# 中,您只需编写以下代码行即可调用 Windows 附带的屏幕键盘应用程序:

System.Diagnostics.Process.Start("osk.exe");

You can find more help here.

您可以在此处找到更多帮助。

回答by Hassan Rahman

For Windows 10 x64, You have set the project build to x64 as shown in image.

对于 Windows 10 x64,您已将项目构建设置为 x64,如图所示。

enter image description here

在此处输入图片说明

Process process = Process.Start(new ProcessStartInfo(
            ((Environment.GetFolderPath(Environment.SpecialFolder.System) + @"\osk.exe"))));