📄 frmmain.frm
字号:
StrSql = "select * from code where word='" & LblText3(Len(TxtInput(Index + 1).Text)) & "'"
End If
SQLChar
End If
If Letter = 3 And Choice = 1 Then '查找一级简码的字根
If Len(TxtInput(Index).Text) < LblText1.Count Then
StrSql = LblText2(Len(TxtInput(Index).Text)).Caption
Else
StrSql = LblText3(0).Caption
End If
OChar
End If
If (Str = LblText2(Len(TxtInput(Index).Text) - 1).Caption) Then
LblText2(Len(TxtInput(Index).Text) - 1).BackColor = &HFF0000
Else
LblText2(Len(TxtInput(Index).Text) - 1).BackColor = &HFF&
End If
End If
For I = Len(TxtInput(Index).Text) To LblText2.Count - 1
LblText2(I).BackColor = &H8000000F
Next I
WordER (Index) '判断字符是是否正确
If Len(TxtInput(Index).Text) = LblText2.Count Then
TxtInput(1).Enabled = False
TxtInput(2).Enabled = True
TxtInput(2).SetFocus
End If
End If
If Index = 2 Then
If (Len(TxtInput(Index).Text) > 0) Then
Str = Mid(TxtInput(Index).Text, Len(TxtInput(Index).Text), 1)
If (Letter = 3 And Choice = 2) Or (Letter = 3 And Choice = 3) Or (Letter = 3 And Choice = 4) Then
If Len(TxtInput(Index).Text) < LblText1.Count Then
StrSql = "select * from code where word='" & LblText3(Len(TxtInput(Index).Text)) & "'"
Else
StrSql = "select * from code where word='" & LblText4(Len(TxtInput(Index + 1).Text)) & "'"
End If
SQLChar
End If
If Letter = 3 And Choice = 1 Then '查找一级简码的字根
If Len(TxtInput(Index).Text) < LblText1.Count Then
StrSql = LblText3(Len(TxtInput(Index).Text)).Caption
Else
StrSql = LblText4(0).Caption
End If
OChar
End If
If (Str = LblText3(Len(TxtInput(Index).Text) - 1).Caption) Then
LblText3(Len(TxtInput(Index).Text) - 1).BackColor = &HFF0000
Else
LblText3(Len(TxtInput(Index).Text) - 1).BackColor = &HFF&
End If
End If
For I = Len(TxtInput(Index).Text) To LblText3.Count - 1
LblText3(I).BackColor = &H8000000F
Next I
WordER (Index) '判断字符是是否正确
If Len(TxtInput(Index).Text) = LblText3.Count Then
TxtInput(2).Enabled = False
TxtInput(3).Enabled = True
TxtInput(3).SetFocus
End If
End If
If Index = 3 Then
If (Len(TxtInput(Index).Text) > 0) Then
Str = Mid(TxtInput(Index).Text, Len(TxtInput(Index).Text), 1)
If (Letter = 3 And Choice = 2) Or (Letter = 3 And Choice = 3) Or (Letter = 3 And Choice = 4) Then
If Len(TxtInput(Index).Text) < LblText1.Count Then
StrSql = "select * from code where word='" & LblText4(Len(TxtInput(Index).Text)) & "'"
Else
StrSql = "select * from code where word='" & LblText5(Len(TxtInput(Index + 1).Text)) & "'"
End If
SQLChar
End If
If Letter = 3 And Choice = 1 Then '查找一级简码的字根
If Len(TxtInput(Index).Text) < LblText1.Count Then
StrSql = LblText4(Len(TxtInput(Index).Text)).Caption
Else
StrSql = LblText5(0).Caption
End If
OChar
End If
If (Str = LblText4(Len(TxtInput(Index).Text) - 1).Caption) Then
LblText4(Len(TxtInput(Index).Text) - 1).BackColor = &HFF0000
Else
LblText4(Len(TxtInput(Index).Text) - 1).BackColor = &HFF&
End If
End If
For I = Len(TxtInput(Index).Text) To LblText4.Count - 1
LblText4(I).BackColor = &H8000000F
Next I
WordER (Index) '判断字符是是否正确
If Len(TxtInput(Index).Text) = LblText4.Count Then
TxtInput(3).Enabled = False
TxtInput(4).Enabled = True
TxtInput(4).SetFocus
End If
End If
If Index = 4 Then
If (Len(TxtInput(Index).Text) > 0) Then
Str = Mid(TxtInput(Index).Text, Len(TxtInput(Index).Text), 1)
If (Letter = 3 And Choice = 2) Or (Letter = 3 And Choice = 3) Or (Letter = 3 And Choice = 4) Then
If Len(TxtInput(Index).Text) < LblText1.Count Then
StrSql = "select * from code where word='" & LblText5(Len(TxtInput(Index).Text)) & "'"
Else
StrSql = "select * from code where word='" & LblText6(Len(TxtInput(Index + 1).Text)) & "'"
End If
SQLChar
End If
If Letter = 3 And Choice = 1 Then '查找一级简码的字根
If Len(TxtInput(Index).Text) < LblText1.Count Then
StrSql = LblText5(Len(TxtInput(Index).Text)).Caption
Else
StrSql = LblText6(0).Caption
End If
OChar
End If
If (Str = LblText5(Len(TxtInput(Index).Text) - 1).Caption) Then
LblText5(Len(TxtInput(Index).Text) - 1).BackColor = &HFF0000
Else
LblText5(Len(TxtInput(Index).Text) - 1).BackColor = &HFF&
End If
End If
For I = Len(TxtInput(Index).Text) To LblText5.Count - 1
LblText5(I).BackColor = &H8000000F
Next I
WordER (Index) '判断字符是是否正确
If Len(TxtInput(Index).Text) = LblText5.Count Then
TxtInput(4).Enabled = False
TxtInput(5).Enabled = True
TxtInput(5).SetFocus
End If
End If
If Index = 5 Then
If (Len(TxtInput(Index).Text) > 0) Then
Str = Mid(TxtInput(Index).Text, Len(TxtInput(Index).Text), 1)
If (Letter = 3 And Choice = 2) Or (Letter = 3 And Choice = 3) Or (Letter = 3 And Choice = 4) Then
If Len(TxtInput(Index).Text) < LblText1.Count Then
StrSql = "select * from code where word='" & LblText6(Len(TxtInput(Index).Text)) & "'"
Else
StrSql = "select * from code where word='" & LblText7(Len(TxtInput(Index + 1).Text)) & "'"
End If
SQLChar
End If
If Letter = 3 And Choice = 1 Then '查找一级简码的字根
If Len(TxtInput(Index).Text) < LblText1.Count Then
StrSql = LblText6(Len(TxtInput(Index).Text)).Caption
Else
StrSql = LblText7(0).Caption
End If
OChar
End If
If (Str = LblText6(Len(TxtInput(Index).Text) - 1).Caption) Then
LblText6(Len(TxtInput(Index).Text) - 1).BackColor = &HFF0000
Else
LblText6(Len(TxtInput(Index).Text) - 1).BackColor = &HFF&
End If
End If
For I = Len(TxtInput(Index).Text) To LblText6.Count - 1
LblText6(I).BackColor = &H8000000F
Next I
WordER (Index) '判断字符是是否正确
If Len(TxtInput(Index).Text) = LblText6.Count Then
TxtInput(5).Enabled = False
TxtInput(6).Enabled = True
TxtInput(6).SetFocus
End If
End If
If Index = 6 Then
If (Len(TxtInput(Index).Text) > 0) Then
Str = Mid(TxtInput(Index).Text, Len(TxtInput(Index).Text), 1)
If (Letter = 3 And Choice = 2) Or (Letter = 3 And Choice = 3) Or (Letter = 3 And Choice = 4) Then
If Len(TxtInput(Index).Text) < LblText1.Count Then
StrSql = "select * from code where word='" & LblText7(Len(TxtInput(Index).Text)) & "'"
End If
SQLChar
End If
If Letter = 3 And Choice = 1 Then '查找一级简码的字根
If Len(TxtInput(Index).Text) < LblText1.Count Then
StrSql = LblText1(Len(TxtInput(Index).Text)).Caption
End If
OChar
End If
If (Str = LblText7(Len(TxtInput(Index).Text) - 1).Caption) Then
LblText7(Len(TxtInput(Index).Text) - 1).BackColor = &HFF0000
Else
LblText7(Len(TxtInput(Index).Text) - 1).BackColor = &HFF&
End If
End If
For I = Len(TxtInput(Index).Text) To LblText7.Count - 1
LblText7(I).BackColor = &H8000000F
Next I
WordER (Index) '判断字符是是否正确
If Len(TxtInput(Index).Text) = LblText7.Count Then
TxtInput(6).Enabled = False
TxtInput(0).Enabled = True
For I = 1 To 6
ER(I) = 0
RG(I) = 0
Next I
CountE = WordE
CountR = WordR
CEY
Unloadlbl
RndABC
TxtInput(0).SetFocus
End If
End If
End If
End Sub
Sub CEY() '清除输入文本框中的信息
Dim I As Integer
For I = 0 To 6
TxtInput(I).Text = ""
TxtInput(I).Enabled = False
Next I
TxtInput(0).Enabled = True
If CEL <> 0 Then
TxtInput(0).SetFocus
End If
End Sub
Sub SQLChar() ' 查找字根
Set dbRed = dbCon.Execute(StrSql)
If Not dbRed.EOF Then
LblSplit.Caption = "五笔拆分:" & dbRed.Fields(0).Value & dbRed.Fields(1).Value
End If
End Sub
Sub OChar() '查找一级简码的字根
For I = 0 To 24
If StrSql = Mid(OneCode(I), 1, 1) Then
LblSplit.Caption = "五笔拆分:" & OneCode(I)
End If
Next I
End Sub
Sub WordER(Index As Integer) '判断正确和错误的文字
WordR = 0
WordE = 0
If Index = 0 Then
For I = 0 To Len(TxtInput(Index).Text) - 1
If LblText1(I).BackColor = &HFF0000 Then
WordR = WordR + 1
Else
WordE = WordE + 1
End If
Next I
End If
If Index = 1 Then
For I = 0 To Len(TxtInput(Index).Text) - 1
If LblText2(I).BackColor = &HFF0000 Then
WordR = WordR + 1
Else
WordE = WordE + 1
End If
Next I
End If
If Index = 2 Then
For I = 0 To Len(TxtInput(Index).Text) - 1
If LblText3(I).BackColor = &HFF0000 Then
WordR = WordR + 1
Else
WordE = WordE + 1
End If
Next I
End If
If Index = 3 Then
For I = 0 To Len(TxtInput(Index).Text) - 1
If LblText4(I).BackColor = &HFF0000 Then
WordR = WordR + 1
Else
WordE = WordE + 1
End If
Next I
End If
If Index = 4 Then
For I = 0 To Len(TxtInput(Index).Text) - 1
If LblText5(I).BackColor = &HFF0000 Then
WordR = WordR + 1
Else
WordE = WordE + 1
End If
Next I
End If
If Index = 5 Then
For I = 0 To Len(TxtInput(Index).Text) - 1
If LblText6(I).BackColor = &HFF0000 Then
WordR = WordR + 1
Else
WordE = WordE + 1
End If
Next I
End If
If Index = 6 Then
For I = 0 To Len(TxtInput(Index).Text) - 1
If LblText7(I).BackColor = &HFF0000 Then
WordR = WordR + 1
Else
WordE = WordE + 1
End If
Next I
End If
ER(Index) = WordE '存放每一行中错误字的个数
RG(Index) = WordR '存放第一行中正确字的个数
WordR = 0
WordE = 0
For I = 0 To Index
WordE = WordE + ER(I)
WordR = WordR + RG(I)
Next I
WordE = WordE + CountE
WordR = WordR + CountR
LblRight.Caption = "正确:" & WordR
LblErrar.Caption = "错误:" & WordE
SWord = 0
For I = 1 To Time_B
SWord = SWord + 60
Next I
SWord = SWord + Time_A
If SWord <> 0 Then
LblWord.Caption = "每分:" & Round((WordR + WordE) / (SWord / 60), 2) & "个字"
End If
End Sub
Sub CountC() '清除练习或测试窗口中原有的值
For I = 1 To 6
ER(I) = 0
RG(I) = 0
Next I
CountE = 0
CountR = 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -