And I need a bit of help sorting it out. Ok heres whats up I am trying to make this timer for someone who is taking a keyborading class. And how I am trying to get it to work Is 1st the person is going to set the timer slider bar to the time they want then the start button will become actvie and when the user presses it the lable bar above the textbox will display the saying they have to try to type within that time limit, if they succeed with in the time limit then a messege box will apper saying exellent then they'll click ok and then a dog will apper in the lable box below and blink at you. Then you can either reset the program or end it. If you are not fast enough then you will get a messege box that says To slow and you can either reset or end the program. BTW under the dog in you make it in the time it will say how many words you typed in how many seceonds.
this is what code I got so far. I am also attching the Pic of what the form looks like.
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
Dim vRecCnt As Integer
Dim DogSwap As Boolean
btnStart.Enabled = True
txtToType.Enabled = True
txtToType.Focus()
tmrTime.Enabled = True
lblTime.Enabled = False
lblTimeExpired.Text = Val(lblTimeExpired)
hsbsettime.Enabled = False
btnStart.Enabled = False
Call GetRandomRecord()
End Sub
Private Sub tmrTime_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrTime.Tick
If Val(lblTimeExpired.Text) >= Val(lblTime.Text) Then
tmrTime.Enabled = False
txtToType.Enabled = False
lblTypeSpeed.Text = "your typing speed is:" & _
(Val(lblTimeExpired.Text)) _
txtToType.Text)& "words per minute."
MsgBox("Your to slow, now you can't go to the boat show", MsgBoxStyle.Information)
btnReset.Enabled = True
btnStart.Enabled = False
Else
If Trim(txtToType.Text) = Trim(lblToType.Text) Then
tmrTime.Enabled = False
txtToType.Enabled = False
End If
End If
End Sub
Private Sub GetRamdomData()
Randomize()
Dim vftyping As String
Dim I As Integer
Dim vrecnum As Integer
FileOpen(1, "typing.txt", OpenMode.Input)
vrecnum = (Rnd() * vRecCnt) + 1
End Sub
Private Sub btnEnd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnd.Click
End
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
FileOpen(1, "typing.txt", OpenMode.Input)
End Sub
Private Sub hsbsettime_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles hsbsettime.Scroll
lblTime.Text = FormatNumber(hsbsettime.Value, 1)
btnStart.Enabled = True
btnReset.Enabled = True
End Sub
Private Sub TmrDog_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TmrDog.Tick
End Sub
End Class
this is what code I got so far. I am also attching the Pic of what the form looks like.
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
Dim vRecCnt As Integer
Dim DogSwap As Boolean
btnStart.Enabled = True
txtToType.Enabled = True
txtToType.Focus()
tmrTime.Enabled = True
lblTime.Enabled = False
lblTimeExpired.Text = Val(lblTimeExpired)
hsbsettime.Enabled = False
btnStart.Enabled = False
Call GetRandomRecord()
End Sub
Private Sub tmrTime_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrTime.Tick
If Val(lblTimeExpired.Text) >= Val(lblTime.Text) Then
tmrTime.Enabled = False
txtToType.Enabled = False
lblTypeSpeed.Text = "your typing speed is:" & _
(Val(lblTimeExpired.Text)) _
txtToType.Text)& "words per minute."
MsgBox("Your to slow, now you can't go to the boat show", MsgBoxStyle.Information)
btnReset.Enabled = True
btnStart.Enabled = False
Else
If Trim(txtToType.Text) = Trim(lblToType.Text) Then
tmrTime.Enabled = False
txtToType.Enabled = False
End If
End If
End Sub
Private Sub GetRamdomData()
Randomize()
Dim vftyping As String
Dim I As Integer
Dim vrecnum As Integer
FileOpen(1, "typing.txt", OpenMode.Input)
vrecnum = (Rnd() * vRecCnt) + 1
End Sub
Private Sub btnEnd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnd.Click
End
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
FileOpen(1, "typing.txt", OpenMode.Input)
End Sub
Private Sub hsbsettime_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles hsbsettime.Scroll
lblTime.Text = FormatNumber(hsbsettime.Value, 1)
btnStart.Enabled = True
btnReset.Enabled = True
End Sub
Private Sub TmrDog_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TmrDog.Tick
End Sub
End Class