|
Sub Pause (ByVal nSecond As Single)
Dim t0 As Single Dim dummy As Integer t0 = Timer Do While Timer - t0 < nSecond dummy = DoEvents() ' If we cross midnight, back up one day If Timer < t0 Then t0 = t0 - 24 * 60 * 60 ' or t0 = t0 - 86400 End If Loop End Sub ' Call the routine from the appropriate event: ' Example: Call Pause(2) ' delay for 2 seconds Form2.Show |