如何在C#中执行Hold ALT + TAB sendkey事件 [英] how to perform a hold ALT+TAB sendkey event in C#

查看:417
本文介绍了如何在C#中执行Hold ALT + TAB sendkey事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用按住ALT键然后按TAB键的sendkey事件.您如何执行该操作,我尝试了许多变体,但似乎找不到答案,谢谢.

I am trying to use a sendkey event that holds the ALT key and then presses the TAB key. How do you perform that action, I've tried many variations but I can't seem to find the answer, thanks.

推荐答案

使用sendkeys PInvoke,可以通过发送ALT键按下事件,TAB键按下,然后TAB键按下,然后ALT键按下来执行此操作.还有另一种在键上使用ALT修饰符的方法,但是我不记得确切的样子,因为我已经有一段时间没有使用它了.

Using sendkeys PInvoke it's possible to do this by sending ALT keydown event, TAB keydown, then TAB keyup, then ALT keyup. There is also another way using the ALT modifier on the key but I cannot remember exactly how as I haven't worked with it in a while.

如果要执行多个选项卡,请同时按住TAB键和TAB键,同时按住TAB键.

If you want to do multiple tabs alternate the TAB keydown and keyup while keeping the ALT on keydown.

这篇关于如何在C#中执行Hold ALT + TAB sendkey事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆