The correct usage of simulating key pressing (SendKeys.Send()) in VB2008

Posted by Admin L in .NET Programming on 16-08-2011. Tags:

Author: Nosa Lee
Original Address: https://www.seeksunslowly.com/vb2008-sendkeys
To reprint this article, please indicate the source, thank you.
_____________________________________

The method of sending key pressing to current input area of Form in VB2008 is similar to VB6, but has slight different and you must pay attention.

VB6’s method:
[cc lang=”vb”]
‘ Simulates the ‘Paste’ action.
SendKeys “^V”
[/cc]

VB2008’s method:
[cc lang=”vbnet”]
‘ Simulates the ‘Paste’ action.
SendKeys.Send(“^v”)
[/cc]

Above, ^ indicates <Ctrl> key, the note that I want to emphasize is: in VB2008, must use lowercase key, such as above ‘v’.

【赞赏 / Reward】

微信         支付宝         PayPal

Post a comment