我试图弄清楚如何将字符“^”(不是CTRL命令)发送到外部文本窗口。
我尝试过这些不同的代码:
SendKeys.SendWait("^");
SendKeys.SendWait("(^)");
Sendkeys.SendWait("{^}"); //This should be the right code, but it doesn't work either
这些人都不会在文本字段中键入字符“^”。 如果我将正常文本发送到窗口,它将显示在窗口中。 “^”不能以某种方式输入。 我查看了MSDN和联机帮助,但找不到任何接近该问题的内容。 有什么想法吗?
答案 0 :(得分:6)
要使用SendKeys.SendWait()
发送字符“^”,您需要考虑实际按下哪些键。在美国的键盘上,它是Shift& 6,转换为:
SendKeys.SendWait("+6");
无论您使用哪个组合键来生成“^”字符,请在SendKeys.SendWait()
调用中输入这些键。