Bonjour,
Pose sur une Form (Form1) : un contrôle Timer (Timer1), un contrôle Label (Label1), un bouton (button1) nommé "Lancer", un bouton (Button2) nommé "Stop", colle le code ci dessous dans la classe de ta form :
Private mStart As Date
Private mTime As Date
Private Sub Button1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click
mStart = TimeOfDay
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Timer1.Tick
mTime = System.Date.FromOADate(TimeOfDay.ToOADate - mStart.ToOADate)
Label1.Text = CStr(mTime)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = False
End Sub
Tu as un chronomètre.
;o)
«Ce que l'on conçoit bien s'énonce clairement, Et les mots pour le dire arrivent aisément.»
Nicolas Boileau