Click to See Complete Forum and Search --> : Pressing Keys
boo
Nov 27th, 1999, 06:59 AM
I want to make a program that presses the up key and then the down key switching off every 2 seconds. I know how to switch them, but I don't know how to make the program press the keys. Please help me do this!
KillaBit
Nov 27th, 1999, 07:10 AM
Add a Timer Control first and set it to Enabled = False. Then:
Timer1.Interval = 2000
Timer1.Enabled = True
SendKeys "{up}" &chr(08) &chr(08)
Depending on what your doing or sending to...it will create 2 numbers if it goes to a textbox so chr(08) will remove them for you!
Use chr(13) to send a Return Carriage (Enter)
KillaBit
Nov 27th, 1999, 07:12 AM
Forgot to mention something. Check the SendKeys help in your VisualBasic Helpfile.
SendKeys "{down}" will send the down arrow!
There ya go! :)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.