سؤال

I've been trying to figure out how to get multiple key strokes with a single command. The goal is to have an effect like:

SendKeys.Send({"TAB"}{"TAB"}{"ENTER"}{"TAB"}{"ENTER"}{"TAB"}{"ENTER"});

I've been able to get two key strokes to work such as

SendKeys.Send(^{"TAB"}) 

However this is press and hold control + press tab. The goal I want is not to hold down a key then press, but to have the button press register multiple times. Thank You!

هل كانت مفيدة؟

المحلول

SendKeys supports sending multiple keys. Why are you using incorrect syntax there? It should really be like:

SendKeys.Send("{TAB}{TAB}{ENTER}{TAB}{ENTER}{TAB}{ENTER}");

نصائح أخرى

Try using SendWait instead

SendKeys.SendWait("{TAB}{TAB}{ENTER}{TAB}");

This will ensure each keystroke is processed first before sending the next and seems to have the desired effect

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top