Resetting Attributes not working
For some reason my reset time isn't working. This part of the code, I want it to basically do what it's saying it's doing, I am checking for the txt boxes to be numberic
If timeM = (txtWDM.Text + txtRDM.Text) And timeS = (txtWDS.Text + txtRDS.Text) Then timeS = 0 timeM = 0 End If
And here is the whole code, Could someone kindly fix my code for me thanks
Private Sub timClock_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles timClock.Tick 'Plays the go sound If timeM = 0 And timeS = 0 Then My.Computer.Audio.Play(My.Resources.Beep_Go, AudioPlayMode.Background) End If 'if Time in seconds below 9 then add 0 to the start of the label If timeS < 9 Then timeS += 1 lbltime.Text = timeM & ":0" & timeS 'If above 9 then make it normal timeS Else timeS += 1 lbltime.Text = timeM & ":" & timeS 'If Seconds are 60 then Add 1 to Minutes and reset Seconds If timeS = 60 Then timeM += 1 timeS = 0 lbltime.Text = timeM & ":0" & timeS End If 'If rest period is reached play Rest Sound If timeM = txtWDM.Text And timeS = txtWDS.Text Then My.Computer.Audio.Play(My.Resources.Beep_Stop, AudioPlayMode.Background) End If 'If Rest period over then Reset process abd go back to play start sound If timeM = (txtWDM.Text + txtRDM.Text) And timeS = (txtWDS.Text + txtRDS.Text) Then timeS = 0 timeM = 0 End If End If End Sub
If timeM = (CInt(txtWDM.Text) + CInt(txtRDM.Text)) And timeS = (CInt(txtWDS.Text) + CInt(txtRDS.Text)) Then timeS = 0 timeM = 0 End If
Also do not create your own way of managing time, as what you did in configuring hour and minutes manually. Take a look at Custom Date and Time.