VB equivalent of a Sleep function? 
Author Message
 VB equivalent of a Sleep function?

Is there any way I can get a VB application to pause for about a second or
so without having to use Timers, like calling a Sleep function for example?
(I'm new to VB.)

Stuart Moncur



Mon, 05 Mar 2001 03:00:00 GMT  
 VB equivalent of a Sleep function?
See the VB Timer function
--
Regards
--Vic--


Quote:
>Is there any way I can get a VB application to pause for about a second or
>so without having to use Timers, like calling a Sleep function for example?
>(I'm new to VB.)

>Stuart Moncur




Mon, 05 Mar 2001 03:00:00 GMT  
 VB equivalent of a Sleep function?

Quote:
>Is there any way I can get a VB application to pause for about a second or
>so without having to use Timers, like calling a Sleep function for example?
>(I'm new to VB.)

Use the Sleep API function.  Put the following in the General Declarations
section of a form:

        Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" _
                       (ByVal dwMilliseconds As Long)

To cause a delay of 1 second:

        Sleep 1000

Lee Weiner
weiner AT fuse DOT net



Mon, 05 Mar 2001 03:00:00 GMT  
 VB equivalent of a Sleep function?
have you looked into the API calls:
Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
Declare Function SleepEx Lib "kernel32" Alias "SleepEx" (ByVal dwMilliseconds
As Long, ByVal bAlertable As Long) As Long

HTH,

Joe in Texas

Quote:

> Is there any way I can get a VB application to pause for about a second or
> so without having to use Timers, like calling a Sleep function for example?
> (I'm new to VB.)

> Stuart Moncur




Tue, 06 Mar 2001 03:00:00 GMT  
 VB equivalent of a Sleep function?
This is what I used
In a BAS module, use this:
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long _
)

Within the function or procedure, use this:
Call Sleep(50)

Above comes from V4(32) help file:
With the 32-bit version of Visual Basic, using the Sleep API function
is more appropriate for 'waiting' in code than using DoEvents.  The
declare for this function is:

Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds _
As Long)

To call the Sleep function, you could use code like the following:

Call Sleep (1000)

Enjoy

Rey (Delphi and VB beginner)

Quote:

>See the VB Timer function
>--
>Regards
>--Vic--



>>Is there any way I can get a VB application to pause for about a second or
>>so without having to use Timers, like calling a Sleep function for example?
>>(I'm new to VB.)

>>Stuart Moncur




Sat, 17 Mar 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Equivalent of Sleep command in VB

2. sleep(x) equivalent

3. The equivalent of Sleep API

4. HELP I NEED SLEEP OR EQUIVALENT CALL!!!

5. sleep function in VB?

6. how to use the sleep function in my vb application

7. Can anyone send Sleep API function implimentation code in VB

8. help : VB equivalents for OUT & INP functions

9. VB function equivalent to DOS: DIR /s command?

10. VB Equivalent for Eval() {Access Basic} or Indirect() {Excel} functions

11. VB's equivalent voor VBA function: IsObjectValid

12. VB Equivalent for Eval() {Access Basic} or Indirect() {Excel} functions

 

 
Powered by phpBB® Forum Software