|
-
April 29th, 2001, 12:07 PM
#1
Wait or Pause
Is there a command pause until something is finished before proceeding to the next command.
I would want to execute a sub and then wait for about 5 seconds then execute another sub.
-
April 29th, 2001, 12:41 PM
#2
Re: Wait or Pause
You can use the Sleep() API function as follows
private Declare Sub Sleep Lib "kernel32" (byval dwMilliseconds as Long)
private Sub Command1_Click()
MsgBox "First one"
Sleep 5000
MsgBox "Second One"
End Sub
-
April 29th, 2001, 12:54 PM
#3
Re: Wait or Pause
I should have more specific. Will this work in VB 6.0?
-
April 29th, 2001, 12:59 PM
#4
Re: Wait or Pause
Yes. It pauses for the number of milliseconds specified.
-
April 29th, 2001, 09:00 PM
#5
Re: Wait or Pause
you can use Sleep API if u want to wait for specific time. However, if u want to wait for certain event to happen, for instance, in communication programming (comm port), if u want to wait for 5 bytes in the receiving buffer, then u will need to use WaitForSingleObject.
HTH
cksiow
http://vblib.virtualave.net - share our codes
-
April 30th, 2001, 05:23 AM
#6
Re: Wait or Pause
I am afraid this will freeze your program for 5 seconds. So, if you have timers on it, they will be paused, too...
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|