⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 vb电子书籍
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BackColor       =   &H00E0E0E0&
   Caption         =   "打字训练"
   ClientHeight    =   2340
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   FillColor       =   &H00C0C0C0&
   BeginProperty Font 
      Name            =   "宋体"
      Size            =   12
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   2340
   ScaleWidth      =   4680
   StartUpPosition =   2  '屏幕中心
   Begin VB.TextBox Text4 
      Height          =   615
      Left            =   1920
      TabIndex        =   9
      Top             =   1560
      Width           =   615
   End
   Begin VB.TextBox Text3 
      Height          =   615
      Left            =   840
      TabIndex        =   8
      Top             =   1560
      Width           =   495
   End
   Begin VB.TextBox Text2 
      Height          =   360
      Left            =   840
      TabIndex        =   7
      Top             =   840
      Width           =   3735
   End
   Begin VB.TextBox Text1 
      Height          =   360
      Left            =   840
      TabIndex        =   6
      Top             =   240
      Width           =   3735
   End
   Begin VB.CommandButton Command2 
      Caption         =   "结束"
      Height          =   375
      Left            =   3720
      TabIndex        =   1
      Top             =   1680
      Width           =   855
   End
   Begin VB.CommandButton Command1 
      Caption         =   "产生"
      Height          =   375
      Left            =   2760
      TabIndex        =   0
      Top             =   1680
      Width           =   855
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "准确率"
      Height          =   840
      Left            =   1560
      TabIndex        =   5
      Top             =   1560
      Width           =   360
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "时间"
      Height          =   240
      Left            =   240
      TabIndex        =   4
      Top             =   1680
      Width           =   480
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "键入"
      Height          =   240
      Left            =   240
      TabIndex        =   3
      Top             =   840
      Width           =   480
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "产生"
      Height          =   240
      Left            =   240
      TabIndex        =   2
      Top             =   240
      Width           =   480
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'CODE Manger By BcodeXRose
'##################################################################
'## 过程名称:Command1_Click
'## 参数: 无
'##################################################################
Dim t As Date
Private Sub Command1_Click()
    Randomize
    Text1 = ""
    For I = 1 To 30
        a = Chr$(Int(Rnd * 26) + 65)
        Text1 = Text1 + a
    Next I
End Sub
    
Private Sub Command2_Click()
    End
End Sub

'##################################################################
'## 过程名称:Text2_GotFocus
'## 参数: 无
'##################################################################
Private Sub Text2_GotFocus()
    t = Time
End Sub
    
'##################################################################
'## 过程名称:Text2_KeyPress
'## 参数:KeyAscii 为Integer型
'##################################################################
Private Sub Text2_KeyPress(KeyAscii As Integer)
    If Len(Text2) = 30 Then
        t2 = DateDiff("s", t, Time)
        Text3 = t2 & "秒"
        Text2.Locked = True
        y = 0: n = 0
        For I = 1 To 30
            If Mid(Text1, I, 1) = Mid(Text2, I, 1) Then
                y = y + 1
            Else
                n = n + 1
            End If
        Next I
        y = y / (y + n) * 100
        Text4 = y & "%"
    End If
    
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -