I'm practically new to Visual Basic. As my first project, I'd like to create a stable 1 minute stopwatch in vb6, I'd like it to ping an event every 1 minute and be synchronized with the system clock. I'm using Visual Studio 2010 on OS XP 64 bit. Suggestions anyone?
Can you help me make 1 minute stopwatch in vb6?
Hi, you can try these codes .
Dim seconds, minutes, hours As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Interval = 1000
Timer1.Start()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Stop()
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If seconds = 60 Then
seconds = 0
minutes = minutes + 1
End If
If minutes = 60 Then
If seconds = 60 Then
seconds = 0
minutes = 0
hours = hours + 1
End If
End If
seconds = seconds + 1
TextBox1.Text = Format(hours, "00") & "." & Format(minutes, "00") & "." & Format(seconds, "00")
End Sub
I hope this will be a success.