SendKey command working with vbs but not C# -
i trying send ctrl+alt+left windows form button (c#) rotate screen. intel hotkey. when press button nothing happening, if use same command in vbs file works.
this c# code not work:
private void button1_click(object sender, eventargs e) { sendkeys.send("^%{left}"); }
vb script work:
set objshell = createobject("wscript.shell") objshell.sendkeys "^%{left}"
i'm new maybe i'm missing obvious?
maybe parenthesis issue:
sendkeys.send("^(%{left})");
you can find more details in documentation stated that:
to specify combination of shift, ctrl, , alt should held down while several other keys pressed, enclose code keys in parentheses. example, specify hold down shift while e , c pressed, use "+(ec)". specify hold down shift while e pressed, followed c without shift, use "+ec".
not sure behaviour of vbs: expect same behavior of c# because vbs documentation sendkeys so...
Comments
Post a Comment