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

发布于 2024-12-26 01:37:40 字数 141 浏览 2 评论 0原文

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

如果给予任何帮助,将不胜感激。谢谢。

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

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

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

万人眼中万个我 2025-01-02 01:37:40

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

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

您可以找到更多帮助 此处

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

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

You can find more help here.

怎会甘心 2025-01-02 01:37:40

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

输入图像描述这里

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

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

enter image description here

Process process = Process.Start(new ProcessStartInfo(
            ((Environment.GetFolderPath(Environment.SpecialFolder.System) + @"\osk.exe"))));
零度℉ 2025-01-02 01:37:40

我尝试在端点内运行 osk 时遇到一些问题。这对我有用:

var onScreenKeyboardProcess = new ProcessStartInfo("osk.exe")
{                    
    UseShellExecute = true
};
Process.Start(onScreenKeyboardProcess);

I had some problems trying to run osk within and endpoint. This works for me:

var onScreenKeyboardProcess = new ProcessStartInfo("osk.exe")
{                    
    UseShellExecute = true
};
Process.Start(onScreenKeyboardProcess);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文