Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Visual Basic ( VB ) (http://www.go4expert.com/forums/visual-basic/)
-   -   how to introduce delay in vb 6.0 (http://www.go4expert.com/forums/introduce-delay-vb-60-t5836/)

ndakota 13Aug2007 18:30

how to introduce delay in vb 6.0
 
as we have delay() function in C/C++ is there any function in Visual Basic?

Is there any way in which timer event can be used to introduce delay?

Please help..

shabbir 13Aug2007 19:25

Re: how to introduce delay in vb 6.0
 
Use the Sleep function

ndakota 18Aug2007 17:13

Re: how to introduce delay in vb 6.0
 
Quote:

Originally Posted by shabbir
Use the Sleep function

Please tell me the syntax and constraints applicable to that function.
also, please let me know if i can open other applications (like notepad) using any inbuilt function in vb.
please tell me the syntax also.

shabbir 18Aug2007 18:43

Re: how to introduce delay in vb 6.0
 
Quote:

Originally Posted by ndakota
Please tell me the syntax and constraints applicable to that function.

Here is the sample.
Code:

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

Private Sub Command1_Click()
  Debug.Print "Started - " & Time()
  Sleep 1000
  Debug.Print "Ended - " & Time()
End Sub

Quote:

Originally Posted by ndakota
please let me know if i can open other applications (like notepad) using any inbuilt function in vb.

You need to be the Shell / ShellEx API and the sample is
Code:

shell("notepad",1)


All times are GMT +5.5. The time now is 11:03.