VB中如何实现键盘快捷键

发布于 2024-12-21 02:42:37 字数 310 浏览 8 评论 0原文

我想知道是否可以使用 VB.NET 自动输入键盘快捷键,如果可以的话如何实现。

在我正在开发的应用程序中,它作为 Outlook 插件接收电子邮件并运行各种检查,如果这些检查是肯定的,它将有关该消息的信息插入数据库。

但我希望能够告诉它,当主题 =“关键字”执行 Ctrl+Alt+ 时,本质上是一个恶作剧。

然而我在任何地方都找不到任何相关内容,我找到的只是“VB.NET 中的自定义快捷方式”以及有关 KeyDown、KeyUp 和 KeyPress 事件的内容。

谢谢

I would like to know if it's possible, and if so how, to use VB.NET to automate the input of a keyboard shortcut.

In the application i am developing, it receives email as a outlook addin and runs various checks and if those checks are positive it inserts information about the message into the database.

But i want to be able to tell it that when the subject = "Keyword" to perform Ctrl+Alt+ for, essentially a prank.

However I can't find anything on this anywhere, all i find is "Custom Short-cuts In VB.NET" and stuff about the KeyDown, KeyUp and KeyPress events.

Thanks

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

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

发布评论

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

评论(1

对不⑦ 2024-12-28 02:42:37

我认为执行此类操作的最简单方法是使用 SendKeys 方法。未经测试,我认为 Ctrl+Alt+ 看起来像:

SendKeys.Send("+(^{UP})")

MSDN SendKeys

I think the easiest way to do such a thing would be to use the SendKeys method. Untested I think Ctrl+Alt+ would look like:

SendKeys.Send("+(^{UP})")

MSDN SendKeys

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文