VB2008 模拟按键 SendKeys.Send() 的正确用法
Posted by Admin L in .NET Programming on 16-08-2011. Tags: .NET 编程经验
作者:牧山道人
原文地址:https://www.seeksunslowly.com/vb2008-sendkeys-sc
转载请注明出处,谢谢。
_____________________________________
VB2008 向窗口当前输入域发送按键的方法用 VB6 类似,但略有不同且必须注意。
VB6 的写法:
[cc lang=”vb”]
‘ 模拟粘贴操作。
SendKeys “^V”
[/cc]
VB2008 的写法:
[cc lang=”vbnet”]
‘ 模拟粘贴操作。
SendKeys.Send(“^v”)
[/cc]
以上,^ 都表示<Ctrl>键,其中要强调的注意事项是:VB2008 中,按键一定要用小写才有效,如上述 v 键。


