Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27061

Help with Timers in visual basic

$
0
0
Hi, i am a beginner trying to learn some visual basic games from youtube so i decided to follow along this persons tutorial on youtube for a mouse game but his timer is confusing me. Can somebody tell me what i did wrong? The problem i am having is that the time label that i have implemented in my form is not increasing or changing at all. how do i fix that?
the code is


Public Class level1

Dim startRun As Boolean
Dim second As Integer
Dim minute As Integer
Dim total As Integer



Private Sub startbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles startbtn.Click
'starts timer
startRun = True
startbtn.Visible = False
finishlbl.Visible = True
Timer1.Enabled = True

End Sub

Private Sub level1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseEnter
'ends timer and tells user they lose if they go out of the label
If startRun = True Then
startRun = False
startbtn.Visible = True
finishlbl.Visible = False
Timer1.Enabled = False
minute = 0
second = 0
total = 0
timelbl.Text = "00:00"
MsgBox("You Lose, You went into the black spot")
End If
End Sub

End Class

here is the link to the youtube link i was following
https://www.youtube.com/watch?v=drSbTyrvVZI

there is a part 1 also but it was on a different topic.

Viewing all articles
Browse latest Browse all 27061

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>