Advertisement
2002C Coding Standards #9714

How to code a "wait" function...

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

AI

Ringkasan AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Kode Sumber
original-source
'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
Komentar Asli (3)
Dipulihkan dari Wayback Machine