编写一个英文打字速度测试程序
(1)单击“产生”按钮在产生文本框内随机产生30个 英文字母;(...
(1)单击“产生”按钮在产生文本框内随机产生30 个 英文字母;(2)当焦点进入键入文本框时开始计时,并显示当 时的时间;(3)在键入文本框按产生的范文输入相应的字母;(4)当输满 30 个字母时结束计时,并且禁止向文本框输入内容,显示打字的速度和正确率
展开
3个回答
展开全部
都不给点分的啊
Dim x As Integer
Private Sub Command1_Click()
Label2.Caption = ""
Text2.Text = ""
For i = 1 To 30
Label2 = Label2 & Chr(Int(Rnd() * 26) + 97)
Next i
End Sub
Private Sub Text2_Change()
Dim r As Integer
If Len(Text2.Text) = 30 Then
Timer1.Enabled = False
Text2.Enabled = False
For i = 1 To 30
If Mid(Text2.Text, i, 1) = Mid(Label2.Caption, i, 1) Then r = r + 1
Label3.Caption = r / 30 * 100
Next i
End If
End Sub
Private Sub Text2_GotFocus()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
x = x + 1
Label1 = x
End Sub
Dim x As Integer
Private Sub Command1_Click()
Label2.Caption = ""
Text2.Text = ""
For i = 1 To 30
Label2 = Label2 & Chr(Int(Rnd() * 26) + 97)
Next i
End Sub
Private Sub Text2_Change()
Dim r As Integer
If Len(Text2.Text) = 30 Then
Timer1.Enabled = False
Text2.Enabled = False
For i = 1 To 30
If Mid(Text2.Text, i, 1) = Mid(Label2.Caption, i, 1) Then r = r + 1
Label3.Caption = r / 30 * 100
Next i
End If
End Sub
Private Sub Text2_GotFocus()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
x = x + 1
Label1 = x
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询