?? tepedform.frm
字號:
char_len = char_len + 1
If char_ke <> 32 Then
rignt_char = rignt_char + 1
Label5.Caption = Str(rignt_char)
current_char = current_char + 1
Label7.Caption = Str(current_char)
End If
Picture1.SetFocus
Else
RichTextBox1(Index).SelStart = char_len - 1
RichTextBox1(Index).SelLength = 1
RichTextBox1(Index).SelColor = vbRed
char_len = char_len + 1
Picture1.SetFocus
If char_ke <> 32 Then '空格不記錄當前字符數
current_char = current_char + 1
Label7.Caption = Str(current_char)
End If
End If
Case 2
If (Mid(RichTextBox1(Index).Text, char_len, 1) = _
Mid(Label1(Index).Caption, char_len, 1)) Then '正確字符
RichTextBox1(Index).SelStart = char_len - 1
RichTextBox1(Index).SelLength = 1
RichTextBox1(Index).SelColor = vbBlue
char_len = char_len + 1
If char_ke <> 32 Then
rignt_char = rignt_char + 1
Label5.Caption = Str(rignt_char)
current_char = current_char + 1
Label7.Caption = Str(current_char)
End If
Picture1.SetFocus
Else
RichTextBox1(Index).SelStart = char_len - 1
RichTextBox1(Index).SelLength = 1
RichTextBox1(Index).SelColor = vbRed
char_len = char_len + 1
Picture1.SetFocus
If char_ke <> 32 Then '空格不記錄當前字符數
current_char = current_char + 1
Label7.Caption = Str(current_char)
End If
End If
Case 3
If (Mid(RichTextBox1(Index).Text, char_len, 1) = _
Mid(Label1(Index).Caption, char_len, 1)) Then '正確字符
RichTextBox1(Index).SelStart = char_len - 1
RichTextBox1(Index).SelLength = 1
RichTextBox1(Index).SelColor = vbBlue
char_len = char_len + 1
If char_ke <> 32 Then
rignt_char = rignt_char + 1
Label5.Caption = Str(rignt_char)
current_char = current_char + 1
Label7.Caption = Str(current_char)
End If
Picture1.SetFocus
Else
RichTextBox1(Index).SelStart = char_len - 1
RichTextBox1(Index).SelLength = 1
RichTextBox1(Index).SelColor = vbRed
char_len = char_len + 1
Picture1.SetFocus
If char_ke <> 32 Then '空格不記錄當前字符數
current_char = current_char + 1
Label7.Caption = Str(current_char)
End If
End If
Case 4
If (Mid(RichTextBox1(Index).Text, char_len, 1) = _
Mid(Label1(Index).Caption, char_len, 1)) Then '正確字符
RichTextBox1(Index).SelStart = char_len - 1
RichTextBox1(Index).SelLength = 1
RichTextBox1(Index).SelColor = vbBlue
char_len = char_len + 1
If char_ke <> 32 Then
rignt_char = rignt_char + 1
Label5.Caption = Str(rignt_char)
current_char = current_char + 1
Label7.Caption = Str(current_char)
End If
Picture1.SetFocus
Else
RichTextBox1(Index).SelStart = char_len - 1
RichTextBox1(Index).SelLength = 1
RichTextBox1(Index).SelColor = vbRed
char_len = char_len + 1
Picture1.SetFocus
If char_ke <> 32 Then '空格不記錄當前字符數
current_char = current_char + 1
Label7.Caption = Str(current_char)
End If
End If
End Select
RichTextBox1(Index).SetFocus
RichTextBox1(Index).SelStart = RichTextBox1(Index).SelStart + 1
If (Len(RichTextBox1(Index).Text) = Len(Label1(Index).Caption)) Then
Debug.Print Index + 1
RichTextBox1(Index + 1).SetFocus
End If
End Sub
Private Sub RichTextBox1_GotFocus(Index As Integer)
'MsgBox Str(RichTextBox1(Index).SelStart)
ScaleMode = 3
char_len = RichTextBox1(Index).SelStart + 1
char_total = all_char '計算字符總數
Label3.Caption = Str(char_total)
Line1.X1 = Label1(1).Left
Line1.Y1 = Label1(1).Top - 2
Line1.X2 = Label1(1).Left + 10
Line1.Y2 = Label1(1).Top - 2
End Sub
Private Sub RichTextBox1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
'在打字輸入框中屏蔽掉方向鍵和刪除鍵等,以避免玩家誤操作
If KeyCode = vbKeyLeft Then KeyCode = 0
If KeyCode = vbKeyRight Then KeyCode = 0
If KeyCode = vbKeyUp Then KeyCode = 0
If KeyCode = vbKeyDown Then KeyCode = 0
If KeyCode = vbKeyDelete Then KeyCode = 0
If KeyCode = vbKeyHome Then KeyCode = 0
If KeyCode = vbKeyEnd Then KeyCode = 0
If KeyCode = 8 Then KeyCode = 0
'用戶點擊Enter計算正確率
'If KeyCode = vbKeyReturn Then
' char_percent = (rignt_char / char_total) * 100
' Label7.Caption = Str(char_percent)
' End If
End Sub
Private Sub RichTextBox1_KeyPress(Index As Integer, KeyAscii As Integer)
Select Case Index
'記錄當當前所打字符
Case 1
char_ke = KeyAscii
Case 2
char_ke = KeyAscii
Case 3
char_ke = KeyAscii
Case 4
char_ke = KeyAscii
End Select
End Sub
'練習文章選擇
Private Sub select_Click()
selectwzForm.Show
End Sub
'開始打字
Private Sub start_type_Click()
'讀如句子
ScaleMode = 3 '以象素為單位
If deforescrapname <> scrapname Then '同一篇不能顯示2次
Dim i As Integer
Debug.Print mode
If mode = False Then
Close #1
If Right(App.Path, 1) <> "\" Then
Open App.Path + "\" + scrapname For Input As #1
deforescrapname = scrapname
Debug.Print scrapname
Else
Open App.Path + scrapname For Input As #1
deforescrapname = scrapname
End If
'MsgBox "fds"
mode = True
End If
'卸載動態加如的label
If mode_label = True Then
For i = 1 To 5 Step 1
Unload Label1(i)
Unload RichTextBox1(i)
char_total = 0
Next i
mode_label = False
End If
i = 1
Dim jz As String
If mode_label = False Then
Do While Not EOF(1)
If i > 5 Then
Exit Sub
End If
jz = Input$(60, #1)
'加載label
Load Label1(i)
Label1(i).Caption = jz
Label1(i).FontSize = 12
Label1(i).FontBold = True
Label1(i).Width = Picture1.Width
Label1(i).Left = 20 / 15
Label1(i).Top = (1000 * i) / 15
'''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''
Label1(i).Visible = True
Load RichTextBox1(i)
RichTextBox1(i).Font.Size = 12
RichTextBox1(i).Font.Bold = True
RichTextBox1(i).Left = Label1(i).Left - 2
RichTextBox1(i).Top = Label1(i).Top + Label1(i).Height + 1
RichTextBox1(i).Width = Label1(i).Width - 20
RichTextBox1(i).Visible = True
RichTextBox1(1).SetFocus
i = i + 1
'Debug.Print currx, curry
'MsgBox "sdfs"
'Debug.Print i
mode_label = True 'label以動態加在
Loop
End If
Else
MsgBox "同一篇不能顯示2次"
End If
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "start"
'讀如句子
ScaleMode = 3
If deforescrapname <> scrapname Then '同一篇不能顯示2次
Dim i As Integer
Debug.Print mode
If mode = False Then
Close #1
If Right(App.Path, 1) <> "\" Then
Open App.Path + "\" + scrapname For Input As #1
deforescrapname = scrapname
Debug.Print scrapname
Else
Open App.Path + scrapname For Input As #1
deforescrapname = scrapname
End If
'MsgBox "fds"
mode = True
End If
'卸載動態加如的label
If mode_label = True Then
For i = 1 To 5 Step 1
Unload Label1(i)
Unload RichTextBox1(i)
char_total = 0
Next i
mode_label = False
End If
i = 1
Dim jz As String
If mode_label = False Then
Do While Not EOF(1)
If i > 5 Then
Exit Sub
End If
jz = Input$(60, #1)
'加載label
Load Label1(i)
Label1(i).Caption = jz
Label1(i).FontSize = 12
Label1(i).FontBold = True
Label1(i).Width = Picture1.Width
Label1(i).Left = 20 / 15
Label1(i).Top = (1000 * i) / 15
Label1(i).Visible = True
''''''''''''''''''''''''''''''''''''''''
'char_total = char_total + Len(jz)
' MsgBox Str(char_total)
'Debug.Print char_total
Label3.Caption = Val(char_total)
''''''''''''''''''''''''''''
Load RichTextBox1(i)
RichTextBox1(i).Font.Size = 12
RichTextBox1(i).Font.Bold = True
RichTextBox1(i).Left = Label1(i).Left
RichTextBox1(i).Top = Label1(i).Top + Label1(i).Height + 1
RichTextBox1(i).Width = Label1(i).Width - 20
RichTextBox1(i).Visible = True
RichTextBox1(1).SetFocus
i = i + 1
'Debug.Print currx, curry
'MsgBox "sdfs"
'Debug.Print i
mode_label = True 'label以動態加在
''要打字的字符總數
Loop
End If
Else
MsgBox "同一篇不能顯示2次"
End If
End Select
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -