Programa de mecanografía escrito en VB
Función: si comete un error tipográfico, la tecla Intro es muy importante. Si escribe la palabra correcta, puede "marcarla". Si escribe la palabra incorrecta, puede "verificar" la precisión. La velocidad es rápida. La interfaz gráfica muestra el mapa del teclado.
(20.000 líneas de código)
Subtexto privado1_Change(Índice como entero)
En caso de error, Ir a text1changewrong:
' Print Mid(Label1(myord Mod 7) .Caption, comenzar 1, myend - comenzar 1)
MouseSetfocusOrAutoSetfocus = False 'Cambiar si se marca el texto1(0) con signos de puntuación para no marcarlo (falso)
Text1(Index ).IMEMode = 9 'Se utiliza para cambiar el estado de entrada
backyn = False 'Habilitar retroceso
Label3.Caption = "myend" amp; p>Label4.Caption = "begin" & Str(begin)
Si clave = 1 Entonces 'Si k=1 'Borrar el cuadro de texto
Para i = 0 a 6
Texto1(i).Text = ""
Texto1(i).Enabled = False
Etiqueta2(i).Caption = ""
p>Siguiente i
Text1(0).Enabled = True
key = 0
'Cola la pregunta aquí (fuera de cuestión, por hacer:.......)
Finalizar si
Si eliminar = 0 Entonces
myend = Texto1(myord Mod 7).> Finalizar si
Si myend - comenzar lt; gt; 0 Entonces
tmstr$ = Mid(Label1(myord Mod 7).Caption, comenzar, myend - comenzar)
dtstr$ = Mid(Text1(myord Mod 7).Text, comenzar, myend - comenzar)
Si tmstr = " " Y dtstr = " " Entonces
Label2( myord Mod 7).Caption = Label2(myord Mod 7).Caption amp; " "
yorn(Text1(Index).SelStart) = 2
'GoTo kung: p>
'Aquí abajo
De lo contrario
Si tmstr$ = dtstr$ Entonces
Label2(myord Mod 7).Caption = Label2(myord Mod 7).Caption "√"
y = y 1 'Agrega uno a la derecha
Label5.Caption = "Correcto: " amp; Str(y) " caracteres"
yorn(Texto1(Índice).SelSt
art) = 1
Else
Label2(myord Mod 7).Caption = Label2(myord Mod 7).Caption "×"
n = n 1 'Agrega uno para el error
Label6.Caption = "Error:" amp; Str(n) amp "word"
Label6.amp; >
yorn(Text1(Index).SelStart) = 0
Fin si
Fin si
Fin si
Si y gt;= 1 Entonces 'El divisor no debe ser 0
Label7.Caption = " Corrección: " & left(Str((y / (y n))* 100), 5) & " " ' Mostrar [Corrección] en etiqueta7
Corrección = left(Str((y / (y n)))* 100), 5) 'Se usa para escribir archivos
Else
Etiqueta7 .Caption = "Corrección:" amp; 0# amp "" 'Mostrar [Corrección] en la etiqueta7
Corrección = 0# 'Al escribir archivos
Finalizar si
Si Text1(myord Mod 7).SelStart gt;= Len(RTrim(Label1(myord Mod 7).Caption)) Entonces
If Text1((Index 1 ) Mod 7).Visible = Falso Entonces
MsgBox "Correcto:" amp; Str(y) amp; "one " amp; Str(n) amp; "one " amp; Label8.Caption, 64, "Informe de prueba"
Cerrar #1
'Form2.Show
Descargar Yo
Salir Sub
'El agua tiene lista de texto
Fin si
Texto1(myord Mod 7 ).SelStart = 1 p>
myord = myord 1
Si myord Mod 7 = 0 Entonces
key = 1 'Utilice la tecla = 1 para indicar que desea borrar todos los cuadros de texto p>
Para m = 0 a 6
Texto1(m).Enabled = Verdadero
Siguiente m
Finalizar si
comenzar = 1
eliminar = 0
Etiqueta2(myord Mod 7).Caption = ""
Para
u = 0 a 6
Texto1(u).Enabled = False
Siguiente u
Texto1(myord Mod 7).
Si Text1(myord Mod 7).Visible = True Then Text1(myord Mod 7).SetFocus
Text1(myord Mod 7).Text = ""
End If
'****************** **************** Este párrafo se utiliza para bloquear el cuadro de texto** **********
Si myord Mod 7 lt;gt; 0 Entonces Texto1(myord Mod 7 - 1).Enabled = False
'*** *************** ******** **************************** *
comenzar = myend p>
Salir de Sub
text1changewrong:
MsgBox "¡El sistema tiene un error y se cerrará!" , 32, "Consejo del sistema"
Descargarme
End Sub
Subtexto privado1_GotFocus(Index As Integer)
Atenuar tuige como Entero 'Se utiliza para guardar texto, el número de fotogramas en los que debe salir la etiqueta.
/p>
Si MouseSetfocusOrAutoSetfocus = True Then Exit Sub
Text1(Index).IMEMode = 9 'Se utiliza para cambiar el estado del método de entrada
If Text1( Index).IMEMode = 9 'Se usa para cambiar el estado del método de entrada
If Text1(Index).IMEMode = 9 'Se usa para cambiar el estado del método de entrada
getnum = getnum 1
Si no (getnum gt; List1.ListCount) Entonces
'a: ' Entrada de línea #1, mytxt
'Si no (Len(Trim(mytxt )) gt; = 1) Luego vaya a:
If Len(mytxt) gt 37 Then mytxt = left(mytxt, 37)
'Label1 (i).Left = Etiqueta1(i).Left (Len(mytxt) - Len(LTrim(mytxt)))* ( 50 / 3)
'Etiqueta2(i).Left = Etiqueta1(i ).Left (Len( mytxt) - Len(LTrim(mytxt)))* (50 / 3)
'Text1(i).Left = Text1(i).Left (Len(mytxt) - Len(mytxt))* (50 / 3)
'Texto1(i).Len(LTrim(mytxt))) * (50 / 3)
'Texto1(i) .* (50 / 3 )
Text1(i).left = 550 'Restaurar la posición de la etiqueta cada vez
Label1(i).left = 600 'Restaurar la posición de la etiqueta cada vez tiempo
Label2(i).left = 600 ' Len(Trim(mytxt)))* Int(7695 / 37)
Label1(i).Caption = Trim(Label1( i).Caption ) '"*** y la República Popular China*** y Weiguo"
Text1(i).left = Text1(i).left tuige 'retreat
Label1(i ).left = Label1(i).left tuige 'retiro
Label2(i).left = Label2(i).left tuige 'retiro
Texto1( i).Text = ""
Label2(i).Caption = ""
Text1(i).MaxLength = Len(Trim(Label1(i).Caption))
Texto1(i).Ancho = Etiqueta1(i).Ancho 100
Etiqueta1(i).Visible = Verdadero
Etiqueta2(i).Visible = Verdadero
Texto1(i).Visible = Verdadero
Else
'Etiqueta1(i -
1).Visible = Falso
' Etiqueta2(i - 1).Visible = Falso
' Texto1(i - 1) p>
Fin.
ReDim yorn(Len(Label1(Index).Caption))As Integer
End Sub
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
'Text1(Index).IMEMode = 1
Si KeyCode = 37 O KeyCode = 39 O KeyCode = 38 O KeyCode = 40 O KeyCode = 35 O KeyCode = 36 O KeyCode = 46 Entonces KeyCode = 0
Si backyn = True y KeyCode = 8 Entonces KeyAscii = 0: Salga de Sub: backyn = False
Si KeyCode = 8 y Text1( myord Mod 7).Caption = "Wrong:" amp; Str(n) amp "words" 'Se usa para reducir el número de correctos e incorrectos (y\n)
Si yorn(Text1(Index) .SelStart) = 0 Entonces n = n - 1: Label6.Caption = "Incorrecto: " amp.Str(n) amp " carácter"
eliminar = 1
Label2( myord Mod 7).Caption = left(Label2(myord Mod 7).Caption, Len(Label2(myord Mod 7).Caption) - 1)