Public Class Form2
Dim sw As New Stopwatch
Private Sub TextEdit1_GotFocus(sender As Object, e As EventArgs) Handles TextEdit1.GotFocus
TextEdit1.SelectAll
End Sub
Private Sub TextEdit1_KeyDown(sender As Object, e As KeyEventArgs) Handles TextEdit1.KeyDown
sw.Start
Label1.Text = sw.ElapsedMilliseconds.ToString
End Sub
Private Sub TextEdit1_KeyUp(sender As Object, e As KeyEventArgs) Handles TextEdit1.KeyUp
Label2.Text = sw.ElapsedMilliseconds.ToString
sw.Stop
sw.Reset
Label3.Text = (CType(Label1.Text , Integer) + CType(Label2.Text , Integer)).ToString
If CType(Label3.Text,Integer ) > 0 And (CType(Label3.Text,Integer ) <= 10) Then
Label4.Text = "Lector"
Else
Label4.Text = "Teclado"
TextEdit1.Focus
End If
End Sub
Private Sub TextEdit1_Leave(sender As Object, e As EventArgs) Handles TextEdit1.Leave
If Label4.Text = "Teclado" Or String.IsNullOrEmpty(TextEdit1.Text) Then
TextEdit1.Focus
End If
End Sub