Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use delay in Visual Basic

Status
Not open for further replies.

Cornelius

MIS
Sep 22, 1999
2
0
0
MY
Hi,<br>
<br>
I am new to Visual Basic. Just wonder how we can use delay like in C++ in Visual Basic. Is it by using the timer control?
 
I use something like this.<br>
<br>
<br>
Sub Pause(interval)<br>
<br>
X = Timer<br>
<br>
While Timer - X &lt; Val(interval)<br>
DoEvents<br>
Wend<br>
<br>
End Sub
 
I use the Sleep command when I need to enter a known delay in msec. i.e. Sleep(10)
 
I tend to use a combination of the two suggestions above, mainly so that the sleeping program will still respond to user input (eventually).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top