VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



How to code a wait function...

by gunti (6 Submissions)
Category: Coding Standards
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (6 Votes)

This code shows you, how you can easily implement a "wait" function into visual-basic...

Rate How to code a wait function...

'place a timer-controle & 3 Labels into your app.
Public Sub Wait(seconds)
  Timer1.Enabled = True
  Me.Timer1.Interval = 1000 * seconds
  While Me.Timer1.Interval > 0
  DoEvents
  Wend
  Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
  Timer1.Interval = 0
End Sub

Private Sub Command1_Click()
  Label1.Caption = "1"
  Wait (5)
  Label2.Caption = "2"
  Wait (5)
  Label3.Caption = "3"
End Sub

Download this snippet    Add to My Saved Code

How to code a wait function... Comments

No comments have been posted about How to code a wait function.... Why not be the first to post a comment about How to code a wait function....

Post your comment

Subject:
Message:
0/1000 characters