Jump to content
xisto Community

defterniko

Members
  • Content Count

    1
  • Joined

  • Last visited

  1. i've just tried that code instead of having a button to start it i'm doing it in the form load. my time to count down is 5 minutes but when it starts it just goes down to 4:59 and does nothing. i waited the 5 minutes to see if it was the label and it wasn't what do you think is wrong?just to add im doing it so the time starts when the program does im not doing it so the user enters the time.this is my code Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load?If InStr(Label3.Text, ":") Then? Dim time() As String? time = Split(Label3.Text, ":", , CompareMethod.Text)? lblTimeMinutes.Text = time(0)? lblTimeSeconds.Text = time(1)? timer1.Interval = 1000? timer1.Start()? ?? End If?End Sub?Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles timer1.Tick? Dim Minutes As Integer? Dim Seconds As Integer? Minutes = 5? Seconds = 0? If Minutes = 0 And Seconds = 0 Then? MsgBox("Game Over")? timer1.Stop()? End? End If? If Seconds = 0 Then? Minutes -= 1? Seconds += 60? End If? Seconds -= 1? If Minutes <> -1 Then? lblTimeMinutes.Text = Minutes? lblTimeSeconds.Text = Seconds? End If?End Sub
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.