Tuesday, November 16, 2010

How to Setup a wait for my code on vb 2008?

Ok I have Visual Basics 2008 and I need a wait code setup to work with this new program I am creating here is the basics:

SendKeys.Send(';Message';)

Wait 2 seconds

SendKeys.Send(';2nd message in the next textbox';)

Wait 2 seconds

SendKeys.Send(';3rd Message in the 3rd textbox';)



Any help is much appreciated and if you need anymore detail please ask.How to Setup a wait for my code on vb 2008?
threading.thread.sleep(2000)



this will pause the thread for 2 secondsHow to Setup a wait for my code on vb 2008?
Use the timer. Set timer to run every 2 seconds. In the timer, call SendKeys. You will need to keep track of what you need to send next. You could use a counter variable that you increment each time in the timer routine. Then either switch on the counter variable, or use it to index an array to figure out what to send next.



HTH

No comments:

Post a Comment