CountDown Timer Coding

rosshodges

Freshman
Joined
Nov 23, 2002
Messages
28
I have done all the basics on my countdown timer program.
Visual Basic:
   Private Sub Close_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Leave.Click
        Me.Close()

    End Sub

    Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem4.Click
        Dim frm As New About()
        frm.Show()
    End Sub


    Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
        Me.ShowInTaskbar = False
        Me.NotifyIcon1.Visible = True
        Me.Hide()
        e.Cancel = False
    End Sub

    Private Sub Tray_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tray.Click
        Me.NotifyIcon1.Visible = True
        Me.Hide()
    End Sub

    Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
        Me.Close()


    End Sub

    Private Sub NotifyIcon1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDown
        If Not Me.Visible Then
            Me.CenterToScreen()
            Me.Show()
            Me.Activate()
            Me.NotifyIcon1.Visible = False
            Me.ShowInTaskbar = False
        End If
    End Sub

    Private Sub NumericUpDown2_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        If NumericUpDown2.Value = 59 Then
            NumericUpDown3.Value += 1
            NumericUpDown2.Value = 0
        End If
    End Sub

    Private Sub NumericUpDown3_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NumericUpDown3.ValueChanged
        If NumericUpDown3.Value = 59 Then
            NumericUpDown1.Value += 1
            NumericUpDown3.Value = 0

        End If
    End Sub

    Private Sub Reset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Reset.Click
        If NumericUpDown3.Value > 0 Then
            NumericUpDown3.Value = 0
        End If
        If NumericUpDown1.Value > 0 Then
            NumericUpDown1.Value = 0
        End If
        If NumericUpDown2.Value > 0 Then
            NumericUpDown2.Value = 0
        End If

    End Sub
End Class

I have one label for the time and hrs:mins:secs and 3 numericupdown boxs again hrs:mins:secs.

I also have 3 timers hrs:mins:secs

I dont no how to link the numericboxs up to the timer and make the label count down.

Any ideas welcome

Regards,
Ross
 
Last edited by a moderator:
You need only one Timer control, and you can use the Tick event.
Set the property Enabled to True and the Intervals to 1000.
 
Back
Top