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

Answers


Use CInt

  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.


Need Your Help

facebook share doesn't display the 'correct' image (Provided og:image URL, was not a valid URL)

facebook image facebook-graph-api facebook-sharer

I have facebook share button on my site. when i try to share my post it displays 'other' image (not that one, which displayed on post). i have meta tag for image(here's image that it should display...

Html missing when using View page source

java python html selenium web-scraping

Im trying to extract all the images from a page. I have used Mechanize Urllib and selenium to extract the Html but the part i want to extract is never there. Also when i view the page source im not...