1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| Public correct As Integer, incorrect As Integer, quest As Integer, nb As Integer
Public Declare Function sndPlaySound32 Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal UFlags As Long) As Long
Sub starttimer() 'Fonction chronometre
Application.OnTime Now + TimeValue("00:00:01"), "nexttick"
test.Label12.Caption = CDate(Feuil3.Range("A1"))
End Sub
Sub nexttick() 'Fonction chronometre (boucle avec starttimer)
If Feuil3.Range("A1") = 0 Then
sndPlaySound32 "C:\Windows\Media\chord.wav", 0
MsgBox "Fin du temps imparti"
Exit Sub
Else
Feuil3.Range("A1").Value = Feuil3.Range("A1").Value - TimeValue("00:00:01")
test.Label12.Caption = CDate(Feuil3.Range("A1"))
starttimer
sndPlaySound32 "C:\Windows\Media\Windows Pop-up Blocked.wav", 0
End If
End Sub
Sub stoptimer() 'Pour stopper le chrono
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:01"), "nexttick", , False
End Sub |
Partager