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

📄 打字文件.frm

📁 简单的打字练习程序,可自定义练习的文章
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "打字"
   ClientHeight    =   2205
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   3990
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2205
   ScaleWidth      =   3990
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Cancel          =   -1  'True
      Caption         =   "退出"
      Height          =   375
      Left            =   2160
      TabIndex        =   6
      Top             =   1680
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Default         =   -1  'True
      Height          =   375
      Left            =   480
      TabIndex        =   5
      Top             =   1680
      Width           =   1215
   End
   Begin VB.Frame Frame1 
      Height          =   1335
      Left            =   360
      TabIndex        =   0
      Top             =   120
      Width           =   3015
      Begin VB.TextBox Text2 
         Height          =   495
         Left            =   1200
         TabIndex        =   4
         Top             =   720
         Width           =   1095
      End
      Begin VB.TextBox Text1 
         Height          =   495
         Left            =   1200
         TabIndex        =   3
         Top             =   120
         Width           =   1095
      End
      Begin VB.Label Label2 
         Caption         =   "学号:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   15
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         TabIndex        =   2
         Top             =   720
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "姓名:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   15
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         TabIndex        =   1
         Top             =   120
         Width           =   975
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Conn As New ADODB.Connection
Dim Con As New ADODB.Connection
Dim Connstr As String
Dim Rec As ADODB.Recordset
Dim Rec1 As ADODB.Recordset
Dim msg As VbMsgBoxResult
Private Sub Command1_Click()
'On Error Resume Next
Set Conn = Nothing
Connstr = "dbq=" & App.Path & "\pfsj.mdb" & ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)}"
Conn.Open Connstr
Set Rec = New ADODB.Recordset
Rec.Open "select * from kssj where XM='" & Text1.Text & "' and ZH='" & Text2.Text & "'", Conn, 1, 3
If Rec.RecordCount > 0 Then
    MsgBox "有此记录,进行测试!"
    Form2.Caption = "打字测试"
    Form2.zhanting.Visible = False
Else
    msg = MsgBox("没有此记录,是否进行练习!", vbQuestion + vbYesNo)
    If msg = vbNo Then
    Rec.Close
    Exit Sub
    End If
    Form2.Caption = "打字练习"
End If
Form2.xm3.Caption = Text1.Text
Form2.xh3.Caption = Text2.Text
Rec.Close

Dim a As Integer
Randomize
a = Int(Rnd * 7 + 1)
Con.Open Connstr
Set Rec1 = New ADODB.Recordset
Rec1.Open "select * from wenzhang where 篇号=" & a, Con, 1, 3
Rec1.MoveFirst
Form2.RichTextBox1(0).TextRTF = Rec1.Fields(1)
Rec1.Close
Form2.Show
Unload Me
End Sub

Private Sub Command2_Click()
End
End Sub

⌨️ 快捷键说明

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