AllAPI Network - The KPD-Team

 
Allapi Network
 API-Guide
 ApiViewer

 API List

 
API Resources
 Tips & Tricks
 VB Tutorials
 Error Lookup
 
Misc Stuff
 VB examples
 VB Tools
 VB Links
 Top Downloads
 
This Site
 Search Engine
 Contact Form
 

Donate to AllAPI.net

Delaying a Visual Basic Program

Here is a very useful means of creating a known delay in VB. in case you need to wait on a different external process to finish.  I recently needed a delay that was independent of CPU clock speed.  This does the trick nicely. VB doesn't have a delay or wait function like most of the other basic languages it seems.

Declarations

Copy this code into the declarations section of the project.

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

Use

To delay the program for 1 second, use this code:

Call Sleep(1000)

 

 

 


Copyright © 1998-2007, The Mentalis.org Team - Privacy statement
Did you find a bug on this page? Tell us!
This site is located at http://allapi.mentalis.org/