بالمرفق العمل
تحتاج الى
Label1
CommandButton1
CommandButton2
و هذا هو الكود
كود PHP:
Dim starttime As Boolean
Private Sub CommandButton1_Click()
'Label1
Label1.Caption = 0
starttime = True
Dim Start As Long
For i = 1 To 30
Start = Timer
Do While Timer < Start + 1 'a 3 second delay (Change To any numer you want)
DoEvents ' Yield To other processes.
Loop
If starttime = True Then
Label1.Caption = Val(Label1.Caption) + 1
Else
Exit Sub
End If
Next i
Label1.Caption = "انتهى الوقت"
End Sub
Private Sub CommandButton2_Click()
starttime = False
End Sub
الاستاذ خليل