May 3, 2015 05:43 AM
(This post was last modified: May 3, 2015 05:46 AM by webwarlock72.)
Ive got a form with 4 stopwatch timers that when hours min or seconds is selected and a number put in 1 textbox and an url in another the stopwatch timer counts down then launches the website. The problem I have is stopwatch timer 3 & 4. Both run fine without the other but if 1 ad 60 seconds in stopwatch 3 then 30 in stopwatch 4 run together SW3 changes to SW4 and they both show the same time. Both on different timers.
I cant find whats causing this to happen.Here is the code for both clocks. Like I said when run together SW3 then copys SW4. Can anyone see why this is happening. Ive been all over it and it looks fine. Maybe a fresh paire of eyes will help.
I hope that made sense :/
I cant find whats causing this to happen.Here is the code for both clocks. Like I said when run together SW3 then copys SW4. Can anyone see why this is happening. Ive been all over it and it looks fine. Maybe a fresh paire of eyes will help.
I hope that made sense :/
Code
' Start Button for SW3******
Button17.Visible = False
If RadioButton1.Checked = True Then
Me.alarmTime = Date.Now.AddHours(input3.Text)
Me.Timer3.Start()
ElseIf RadioButton2.Checked = True Then
Me.alarmTime = Date.Now.AddMinutes(input3.Text)
Me.Timer3.Start()
ElseIf RadioButton3.Checked = True Then
Me.alarmTime = Date.Now.AddSeconds(input3.Text)
Me.Timer3.Start()
End If
' Timer for SW3******
Private Sub Timer8_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
If alarmTime < Date.Now Then
Me.Timer3.Stop()
Button17.Visible = True
System.Diagnostics.Process.Start(url3.Text)
Call Audio()
Me.Visible = True
Else
Dim remainingTime As TimeSpan = Me.alarmTime.Subtract(Date.Now)
Me.clock3.Text = String.Format("{0}:{1:d2}:{2:d2}", _
remainingTime.Hours, _
remainingTime.Minutes, _
remainingTime.Seconds)
End If
End Sub
******
' Start button for SW4******
Button15.Visible = False
If RadioButton12.Checked = True Then
Me.alarmTime = Date.Now.AddHours(input4.Text)
Me.Timer4.Start()
ElseIf RadioButton11.Checked = True Then
Me.alarmTime = Date.Now.AddMinutes(input4.Text)
Me.Timer4.Start()
ElseIf RadioButton10.Checked = True Then
Me.alarmTime = Date.Now.AddSeconds(input4.Text)
Me.Timer4.Start()
End If
' Timer for SW4******
Private Sub Timer7_Tick(sender As Object, e As EventArgs) Handles Timer4.Tick
If alarmTime < Date.Now Then
Me.Timer4.Stop()
Button15.Visible = True
System.Diagnostics.Process.Start(url4.Text)
Call Audio()
Me.Visible = True
Else
Dim remainingTime As TimeSpan = Me.alarmTime.Subtract(Date.Now)
Me.clock4.Text = String.Format("{0}:{1:d2}:{2:d2}", _
remainingTime.Hours, _
remainingTime.Minutes, _
remainingTime.Seconds)
End If
End Sub

