Hi I am new to vb and I am using vb 2008 I am trying to learn loops and timers but I have some problems.
Here is my code
The problem with this is it does not wait it just sends 123 all at the same time.Code:'application to send keys to AppActivate("notepad") 'send key1 SendKeys.Send("1") 'wait 2 second Timer1.Enabled = True 'send key2 SendKeys.Send("2") 'wait 2 second Timer1.Enabled = True 'send key 3 SendKeys.Send("3")
I tryed using the other way the one that makes the program freez for the amount of time I want it to wait, but I dont want the program to freez I want to bealbe to move my mouse ext whilst its doing it.
as for the loop this is as far as I got I cant really test it yet cos my program is typing 123 a million times a second and my pc doesnt like that so i need to fix the timers.
any help would be much apprecated thanksCode:Do Until Button2 Is AcceptButton 'application to send keys to AppActivate("notepad") 'send key1 SendKeys.Send("1") 'wait 1 second Timer1.Enabled = True 'send key2 SendKeys.Send("2") 'wait 1 second Timer1.Enabled = True 'send key 3 SendKeys.Send("3") Loop End Sub![]()




Reply With Quote