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

📄 frmtest.frm

📁 一个打字程序 不错的
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmTest 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "WPM Test, by: Patrick Moore (Zelda)"
   ClientHeight    =   2805
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5190
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmTest.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2805
   ScaleWidth      =   5190
   StartUpPosition =   3  'Windows Default
   Begin VB.Timer tmrTesting 
      Interval        =   100
      Left            =   6000
      Top             =   240
   End
   Begin VB.CommandButton cmdOk 
      Caption         =   "Ok"
      Default         =   -1  'True
      Height          =   495
      Left            =   1920
      TabIndex        =   5
      Top             =   3840
      Width           =   735
   End
   Begin VB.TextBox txt 
      Appearance      =   0  'Flat
      Height          =   285
      Left            =   360
      TabIndex        =   3
      Top             =   1800
      Width           =   4455
   End
   Begin VB.Label lblContact 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "E-mail: ZeldaEnt@aol.com, AIM: Medicare"
      Height          =   195
      Left            =   960
      TabIndex        =   9
      Top             =   690
      Width           =   3000
   End
   Begin VB.Label lblAbout 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Source code provided by: Patrick Moore (Zelda)"
      Height          =   195
      Left            =   960
      TabIndex        =   8
      Top             =   480
      Width           =   3420
   End
   Begin VB.Label lblWPMTest 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   " WPM Test"
      Height          =   195
      Left            =   375
      TabIndex        =   7
      Top             =   135
      Width           =   765
   End
   Begin VB.Shape Shape2 
      BackStyle       =   1  'Opaque
      Height          =   255
      Left            =   360
      Top             =   120
      Width           =   855
   End
   Begin VB.Shape Shape1 
      Height          =   2415
      Left            =   120
      Top             =   240
      Width           =   4935
   End
   Begin VB.Image Image1 
      Height          =   480
      Left            =   360
      Picture         =   "frmTest.frx":0E42
      Top             =   360
      Width           =   480
   End
   Begin VB.Label lblSec 
      BackStyle       =   0  'Transparent
      Caption         =   "0"
      Height          =   495
      Left            =   1320
      TabIndex        =   6
      Top             =   3240
      Visible         =   0   'False
      Width           =   1695
   End
   Begin VB.Label lblEnter 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "Press enter when you have completed re-typing the phrase."
      Height          =   195
      Left            =   120
      TabIndex        =   4
      Top             =   2280
      Width           =   4935
   End
   Begin VB.Label lblRetypeHere 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Re-type here:"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   195
      Left            =   360
      TabIndex        =   2
      Top             =   1560
      Width           =   1170
   End
   Begin VB.Label lblPhrase 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "Mr. Johnson was proud of Miss Susan"
      ForeColor       =   &H80000008&
      Height          =   255
      Left            =   360
      TabIndex        =   1
      Top             =   1200
      Width           =   4455
   End
   Begin VB.Label lblInstructions 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "When you're ready, re-type the following phrase:"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   195
      Left            =   360
      TabIndex        =   0
      Top             =   960
      Width           =   4140
   End
End
Attribute VB_Name = "frmTest"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public Testing As Boolean
'You can change what the user has to type,
'so long as it is about 6 words, or 7 using
'small articles or titles (and, or, Mr., Ms., etc)

Private Sub cmdOk_Click()
Dim WPM, Mistakes As String
'Tell the timer to stop adding
'time to the time it took to type
Testing = False

'See if they made any mistakes while typing
If LCase(lblPhrase.Caption) <> LCase(txt.Text) Then Mistakes = "  However, you made some mistakes while re-typing the phrsae."

'Average out the Words Per Minute
'Figure they got about 6 words in lblsec.Caption seconds,
'So we divide the number of seconds it took them into one
'minute (60 seconds) and multiply that by 6 words
WPM = (60 / lblSec.Caption) * 6

'Cut the WPM one digit after the decimal
'Incase we get a result of 92.34234323, etc.
If InStr(WPM, ".") > 0 Then WPM = Left(WPM, InStr(WPM, ".") + 2)

'Notify the user
MsgBox "It took you " & lblSec.Caption & " seconds to re-type the phrase.  This is a typing skill of about " & WPM & " words per minute." & Mistakes, vbExclamation + vbOKOnly

'Reset the seconds caption
lblSec.Caption = 0

'Reset the re-typing textbox
txt.Text = ""

'Make sure the timer isn't adding time
Testing = False
End Sub

Private Sub tmrTesting_Timer()
'See if we're testing
If Testing = True Then
    'If we are, add .1 seconds to the time it takes
    lblSec.Caption = lblSec.Caption + 0.1
End If
End Sub

Private Sub txt_Change()
'See if we're testing
'If we aren't, tell the timer we are and reset
'the time caption
If Testing = False Then lblSec.Caption = 0: Testing = True
End Sub

⌨️ 快捷键说明

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