how can i exit an active sub when timer is stopped.

  • Thread starter Thread starter Majed Abbas
  • Start date Start date
M

Majed Abbas

Guest
I have a button and a timer, I want to:
when timer is stopped, exit button click event.
I have no idea how to do it

timer code is:

Private Sub Tmr_Tick(sender As Object, e As EventArgs) Handles Tmr.Tick
If timeLeft > 0 Then

timeLeft -= 1
TextBox2.Text = timeLeft & " seconds"
Else

Tmr.Stop()
TextBox2.Text = "Time's up!"

End If
End Sub

button code is:

Private Sub Btnrät_Click(sender As Object, e As EventArgs) Handles Btnrät.Click
If Lbltecen.Text = "+" Then
plus()
ElseIf Lbltecen.Text = "-" Then
minus()
ElseIf Lbltecen.Text = "x" Then
Gånger()
ElseIf Lbltecen.Text = "÷" Then
Delat()
ElseIf Lbltecen.Text = "plus" Then
Wath()
End If

End Sub

Continue reading...
 
Back
Top