VB!!!!求助啊!!!!编制打字练习程序。首先单击“产生”按钮,在文本框1随机产生一串大写字母,在文本
请加上分,劳有所得
VB 编制打字练习程序。首先单击“产生”,在文本框1随机产生一串大写字母,在文本框2,练打字键入……
Dim s$, t%Private Sub Command1_Click()For i = 1 To 50a = Int(Rnd * 26 + 65)s = s + UCase(Chr(a))Text1 = sPrivate Sub Command2_Click()Timer1.Enabled = FalsePrivate Sub Form_Load()Timer1.Interval = 1000Text1 = "": Text2 = "": Text3 = "": Text4 = ""Private Sub Text2_Click()Timer1.Enabled = TruePrivate Sub Timer1_Timer()Static p!, sum%, m%t = t + 1Text3 = tm = Len(Text2)For i = 1 To mIf Mid(Text2, i, 1) = Mid(s, i, 1) Thensum = sum + 1p = sum / mText4 = p * 100 & "%"End Sub