Dim score As Integer
Sub CreatChr()
Randomize
Label1.Caption = Chr(Int(Rnd * 26) + 97)
Label1.Left = Int(Rnd * Form1.Width)
Label1.Top = Int(Rnd * Form1.Height) + 200
End Sub Private Sub Check1_Click()
Check2.Value = False
Check3.Value = False
End Sub Private Sub Check2_Click()
Check1.Value = False
Check3.Value = False
End Sub Private Sub Check3_Click()
Check1.Value = False
Check2.Value = False
End Sub Private Sub Check4_Click()
Check5.Value = False
Check6.Value = False End Sub Private Sub Check5_Click()
Check4.Value = False
Check6.Value = False
End Sub Private Sub Check6_Click()
Check4.Value = False
Check5.Value = False
End Sub Private Sub Command1_Click()
CreatChr
Timer1.Enabled = True
Timer2.Enabled = True
Command1.Visible = False
Label5.Caption = 30
Label4.Caption = 0
Label6.Visible = False
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) = Label1.Caption Then
CreatChr
score = score + 1
Label4.Caption = score
End If
End Sub Private Sub Form_Load()
Randomize
Form1.WindowState = 2
End Sub Private Sub Timer1_Timer()
Label1.Top = Label1.Top + 200
If Label1.Top > Form1.Height Then
CreatChr
End If
End Sub Private Sub Timer2_Timer()
Label5.Caption = Val(Label5.Caption) - 1
If Val(Label5.Caption) <= 0 Then
Timer1.Enabled = False
Timer2.Enabled = False
Label1.Caption = ""
Form1.WindowState = 0
Select Case score
Case Is <= 20
MsgBox "初级水平!", vbCritical + vbOKOnly, "评分"
Case Is <= 40
MsgBox "中级水平!", vbInformation + vbOKOnly, "评分"
Case Is > 40
MsgBox "中上水平!", vbExclamation + vbOKOnly, "评分"
End Select
Command1.Visible = True
End If
End Sub
Sub CreatChr()
Randomize
Label1.Caption = Chr(Int(Rnd * 26) + 97)
Label1.Left = Int(Rnd * Form1.Width)
Label1.Top = Int(Rnd * Form1.Height) + 200
End Sub Private Sub Check1_Click()
Check2.Value = False
Check3.Value = False
End Sub Private Sub Check2_Click()
Check1.Value = False
Check3.Value = False
End Sub Private Sub Check3_Click()
Check1.Value = False
Check2.Value = False
End Sub Private Sub Check4_Click()
Check5.Value = False
Check6.Value = False End Sub Private Sub Check5_Click()
Check4.Value = False
Check6.Value = False
End Sub Private Sub Check6_Click()
Check4.Value = False
Check5.Value = False
End Sub Private Sub Command1_Click()
CreatChr
Timer1.Enabled = True
Timer2.Enabled = True
Command1.Visible = False
Label5.Caption = 30
Label4.Caption = 0
Label6.Visible = False
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) = Label1.Caption Then
CreatChr
score = score + 1
Label4.Caption = score
End If
End Sub Private Sub Form_Load()
Randomize
Form1.WindowState = 2
End Sub Private Sub Timer1_Timer()
Label1.Top = Label1.Top + 200
If Label1.Top > Form1.Height Then
CreatChr
End If
End Sub Private Sub Timer2_Timer()
Label5.Caption = Val(Label5.Caption) - 1
If Val(Label5.Caption) <= 0 Then
Timer1.Enabled = False
Timer2.Enabled = False
Label1.Caption = ""
Form1.WindowState = 0
Select Case score
Case Is <= 20
MsgBox "初级水平!", vbCritical + vbOKOnly, "评分"
Case Is <= 40
MsgBox "中级水平!", vbInformation + vbOKOnly, "评分"
Case Is > 40
MsgBox "中上水平!", vbExclamation + vbOKOnly, "评分"
End Select
Command1.Visible = True
End If
End Sub