問題描述
我正在嘗試使用一個 sendkey 事件,該事件持有 ALT 鍵,然后按 TAB 鍵.您如何執(zhí)行該操作,我嘗試了很多變體,但似乎找不到答案,謝謝.
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 可以通過發(fā)送 ALT keydown 事件,TAB keydown,然后 TAB keyup,然后 ALT keyup 來做到這一點.還有另一種在鍵上使用 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.
如果您想在保持 ALT 為 keydown 的同時交替使用 TAB 鍵和鍵.
If you want to do multiple tabs alternate the TAB keydown and keyup while keeping the ALT on keydown.
這篇關于如何在 C# 中執(zhí)行按住 ALT+TAB 發(fā)送鍵事件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!