如何用VB程序做打字软件?
1个回答
展开全部
ElseIf m > 1 And m <= 10 Then
MsgBox "你还要继续努力!", vbInformation, "评价"ElseMsgBox "你是打字高手!", vbInformation, "评价"End IfEnd SubPrivate Sub Command2_Click()EndEnd SubPrivate Sub Command5_Click()RandomizeText1 = ""num = Int(30 * Rnd + 1)
For j = 1 To 30
i = Int(3 * Rnd + 1)
Select Case i '重点就是下面的几个Case 1chr1 = Int(26 * Rnd + 65) '26就是表示有26个字母,65就是大写字母ACase 2chr1 = Int(26 * Rnd + 97) '97就是小写字母aCase 3chr1 = Int(10 * Rnd + 48) '10就是表示有10个数字(0--9),48就是数字0End SelectText1 = Text1 & Chr(chr1)NextTimer1.Enabled = TrueEnd SubPrivate Sub Command6_Click()y = NowText6.Text = Format(y - x, "hh:mm:ss")
Timer1.Enabled = FalseEnd SubPrivate Sub Form_Load()End SubPrivate Sub Label7_Click()
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Timer1.Enabled = FalseEnd SubPrivate Sub Text2_GotFocus()t = Timex = Nowy = NowText6.Text = Format(y - x, "hh:mm:ss")End SubPrivate Sub Text2_KeyPress(KeyAscii As Integer)
If Len(Text2) = 30 Then '键入满30个字符
t2 = DateDiff("s", t, Time) '计算速度
Text3 = t2 & "秒" '显示速度
m = 0: n = 0
For j = 1 To 30 '比较正确率
MsgBox "你还要继续努力!", vbInformation, "评价"ElseMsgBox "你是打字高手!", vbInformation, "评价"End IfEnd SubPrivate Sub Command2_Click()EndEnd SubPrivate Sub Command5_Click()RandomizeText1 = ""num = Int(30 * Rnd + 1)
For j = 1 To 30
i = Int(3 * Rnd + 1)
Select Case i '重点就是下面的几个Case 1chr1 = Int(26 * Rnd + 65) '26就是表示有26个字母,65就是大写字母ACase 2chr1 = Int(26 * Rnd + 97) '97就是小写字母aCase 3chr1 = Int(10 * Rnd + 48) '10就是表示有10个数字(0--9),48就是数字0End SelectText1 = Text1 & Chr(chr1)NextTimer1.Enabled = TrueEnd SubPrivate Sub Command6_Click()y = NowText6.Text = Format(y - x, "hh:mm:ss")
Timer1.Enabled = FalseEnd SubPrivate Sub Form_Load()End SubPrivate Sub Label7_Click()
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Timer1.Enabled = FalseEnd SubPrivate Sub Text2_GotFocus()t = Timex = Nowy = NowText6.Text = Format(y - x, "hh:mm:ss")End SubPrivate Sub Text2_KeyPress(KeyAscii As Integer)
If Len(Text2) = 30 Then '键入满30个字符
t2 = DateDiff("s", t, Time) '计算速度
Text3 = t2 & "秒" '显示速度
m = 0: n = 0
For j = 1 To 30 '比较正确率
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询