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

📄 form1.frm

📁 一个用键盘控制的抢答软件
💻 FRM
字号:
VERSION 5.00
Object = "{6BF52A50-394A-11D3-B153-00C04F79FAA6}#1.0#0"; "wmp.dll"
Begin VB.Form Form1 
   Caption         =   "抢答软件"
   ClientHeight    =   11010
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   15240
   LinkTopic       =   "Form1"
   ScaleHeight     =   11010
   ScaleWidth      =   15240
   StartUpPosition =   3  '窗口缺省
   WhatsThisButton =   -1  'True
   WhatsThisHelp   =   -1  'True
   Begin VB.TextBox Text2 
      Height          =   270
      Left            =   15240
      TabIndex        =   3
      Top             =   10920
      Width           =   180
   End
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   100
      Left            =   10920
      Top             =   10440
   End
   Begin VB.CommandButton Command2 
      Caption         =   "清空结果"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   15
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   855
      Left            =   9000
      TabIndex        =   1
      Top             =   4320
      Width           =   1815
   End
   Begin VB.CommandButton Command1 
      Caption         =   "开始抢答"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   15
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   855
      Left            =   4200
      TabIndex        =   0
      Top             =   4320
      Width           =   1815
   End
   Begin VB.TextBox Text1 
      Height          =   495
      Left            =   9360
      TabIndex        =   2
      Top             =   4560
      Width           =   1215
   End
   Begin WMPLibCtl.WindowsMediaPlayer WindowsMediaPlayer2 
      Height          =   615
      Left            =   0
      TabIndex        =   11
      Top             =   9600
      Visible         =   0   'False
      Width           =   3255
      URL             =   ""
      rate            =   1
      balance         =   0
      currentPosition =   0
      defaultFrame    =   ""
      playCount       =   1
      autoStart       =   -1  'True
      currentMarker   =   0
      invokeURLs      =   -1  'True
      baseURL         =   ""
      volume          =   50
      mute            =   0   'False
      uiMode          =   "full"
      stretchToFit    =   0   'False
      windowlessVideo =   0   'False
      enabled         =   -1  'True
      enableContextMenu=   -1  'True
      fullScreen      =   0   'False
      SAMIStyle       =   ""
      SAMILang        =   ""
      SAMIFilename    =   ""
      captioningID    =   ""
      enableErrorDialogs=   0   'False
      _cx             =   5741
      _cy             =   1085
   End
   Begin WMPLibCtl.WindowsMediaPlayer WindowsMediaPlayer1 
      Height          =   735
      Left            =   0
      TabIndex        =   10
      Top             =   10200
      Visible         =   0   'False
      Width           =   3255
      URL             =   ""
      rate            =   1
      balance         =   0
      currentPosition =   0
      defaultFrame    =   ""
      playCount       =   1
      autoStart       =   -1  'True
      currentMarker   =   0
      invokeURLs      =   -1  'True
      baseURL         =   ""
      volume          =   50
      mute            =   0   'False
      uiMode          =   "full"
      stretchToFit    =   0   'False
      windowlessVideo =   0   'False
      enabled         =   -1  'True
      enableContextMenu=   -1  'True
      fullScreen      =   0   'False
      SAMIStyle       =   ""
      SAMILang        =   ""
      SAMIFilename    =   ""
      captioningID    =   ""
      enableErrorDialogs=   0   'False
      _cx             =   5741
      _cy             =   1296
   End
   Begin VB.Label Label6 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   42
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   840
      Left            =   2880
      TabIndex        =   9
      Top             =   7920
      Width           =   435
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   72
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   1455
      Left            =   6600
      TabIndex        =   8
      Top             =   7920
      Width           =   735
   End
   Begin VB.Label Label4 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   36
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   720
      Left            =   2520
      TabIndex        =   7
      Top             =   6360
      Width           =   375
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "软件制作:金陵科技学院 机电工程学院"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      Left            =   10680
      TabIndex        =   6
      Top             =   10680
      Width           =   4470
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   $"Form1.frx":0000
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   36
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1440
      Left            =   5520
      TabIndex        =   5
      Top             =   3120
      Width           =   9360
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "第五届今日之星"
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   72
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1455
      Left            =   2520
      TabIndex        =   4
      Top             =   1440
      Width           =   10185
   End
   Begin VB.Image Image1 
      Appearance      =   0  'Flat
      Height          =   11160
      Left            =   0
      Picture         =   "Form1.frx":0020
      Stretch         =   -1  'True
      Top             =   0
      Width           =   15360
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public z As Integer

Private Sub Command1_click()
WindowsMediaPlayer2.Controls.stop
WindowsMediaPlayer1.Controls.stop
z = 0
Text1 = ""
Text1.SetFocus
Label4 = "抢答已经开始!离本题结束还有:"
Label5 = ""
Label6 = ""
Timer1.Enabled = False
Timer1.Enabled = True
End Sub

Private Sub Command2_Click()
Dim a As Integer
WindowsMediaPlayer1.Controls.stop
WindowsMediaPlayer2.Controls.stop
Label4 = ""
Label5 = ""
Label6 = ""
Text1 = ""
Text2 = ""
Timer1.Enabled = False
Text2.SetFocus
End Sub



Private Sub Text1_Change()
Dim a As Integer
If Text1 <> "" Then
a = Asc(Text1)
WindowsMediaPlayer2.Controls.stop
WindowsMediaPlayer1.Controls.stop
    If a = 61 Then
        Label6 = "抢答结束:1组请回答问题"
        Timer1.Enabled = False
        Label4 = ""
        Label5 = ""
    ElseIf a = 44 Then
        Label6 = "抢答结束:2组请回答问题"
        Timer1.Enabled = False
        Label4 = ""
        Label5 = ""
    ElseIf a = 83 Or a = 115 Then
        Label6 = "抢答结束:3组请回答问题"
        Timer1.Enabled = False
        Label4 = ""
        Label5 = ""
    ElseIf a = 55 Then
        Label6 = "抢答结束:4组请回答问题"
        Timer1.Enabled = False
        Label4 = ""
        Label5 = ""
    ElseIf a = 86 Or a = 118 Then
        Label6 = "抢答结束:5组请回答问题"
        Timer1.Enabled = False
        Label4 = ""
        Label5 = ""
    ElseIf a = 65 Or a = 97 Then
        Label6 = "抢答结束:6组请回答问题"
        Timer1.Enabled = False
        Label4 = ""
        Label5 = ""
    ElseIf a = 69 Or a = 101 Then
        Label6 = "抢答结束:7组请回答问题"
        Timer1.Enabled = False
        Label4 = ""
        Label5 = ""
    ElseIf a = 48 Then
        Label6 = "抢答结束:8组请回答问题"
        Timer1.Enabled = False
        Label4 = ""
        Label5 = ""
    ElseIf a = 51 Then
        Label6 = "抢答结束:9组请回答问题"
        Timer1.Enabled = False
        Label4 = ""
        Label5 = ""
    ElseIf a = 89 Or a = 121 Then
        Label6 = "抢答结束:10组请回答问题"
        Timer1.Enabled = False
        Label4 = ""
        Label5 = ""
    Else
        Text1 = ""
    End If
End If
End Sub

Private Sub Text2_Change()
Dim a As Integer
If Text2 <> "" Then
a = Asc(Text2)
WindowsMediaPlayer2.Controls.stop
WindowsMediaPlayer1.Controls.stop
    If a = 61 Then
        Label6 = "1组偷抢问题,取消本题资格"
        Label4 = ""
        Label5 = ""
    ElseIf a = 44 Then
        Label6 = "2组偷抢问题,取消本题资格"
        Label4 = ""
        Label5 = ""
    ElseIf a = 83 Or a = 115 Then
        Label6 = "3组偷抢问题,取消本题资格"
        Label4 = ""
        Label5 = ""
    ElseIf a = 55 Then
        Label6 = "4组偷抢问题,取消本题资格"
        Label4 = ""
        Label5 = ""
    ElseIf a = 86 Or a = 118 Then
        Label6 = "5组偷抢问题,取消本题资格"
        Label4 = ""
        Label5 = ""
    ElseIf a = 65 Or a = 97 Then
        Label6 = "6组偷抢问题,取消本题资格"
        Label4 = ""
        Label5 = ""
    ElseIf a = 69 Or a = 101 Then
        Label6 = "7组偷抢问题,取消本题资格"
        Label4 = ""
        Label5 = ""
    ElseIf a = 48 Then
        Label6 = "8组偷抢问题,取消本题资格"
        Label4 = ""
        Label5 = ""
    ElseIf a = 51 Then
        Label6 = "9组偷抢问题,取消本题资格"
        Label4 = ""
        Label5 = ""
    ElseIf a = 89 Or a = 121 Then
        Label6 = "10组偷抢问题,取消本题资格"
        Label4 = ""
        Label5 = ""
    Else
        Text2 = ""
    End If
End If
End Sub

Private Sub Timer1_Timer()
Dim b As Integer
z = z + 1
b = (200 - z) / 10
Label5 = b & "秒"
If z = 1 Then
    WindowsMediaPlayer2.Controls.stop
    WindowsMediaPlayer2.URL = "C:\TICK2.wav"
    WindowsMediaPlayer2.Controls.play
ElseIf z = 19 Then
    WindowsMediaPlayer2.Controls.stop
    WindowsMediaPlayer2.URL = "C:\TICK2.wav"
    WindowsMediaPlayer2.Controls.play
ElseIf z = 37 Then
    WindowsMediaPlayer2.Controls.stop
    WindowsMediaPlayer2.URL = "C:\TICK2.wav"
    WindowsMediaPlayer2.Controls.play
ElseIf z = 55 Then
    WindowsMediaPlayer2.Controls.stop
    WindowsMediaPlayer2.URL = "C:\TICK2.wav"
    WindowsMediaPlayer2.Controls.play
ElseIf z = 73 Then
    WindowsMediaPlayer2.Controls.stop
    WindowsMediaPlayer2.URL = "C:\TICK2.wav"
    WindowsMediaPlayer2.Controls.play
ElseIf z = 91 Then
    WindowsMediaPlayer2.Controls.stop
    WindowsMediaPlayer2.URL = "C:\TICK2.wav"
    WindowsMediaPlayer2.Controls.play
ElseIf z = 109 Then
    WindowsMediaPlayer2.Controls.stop
    WindowsMediaPlayer2.URL = "C:\TICK2.wav"
    WindowsMediaPlayer2.Controls.play
ElseIf z = 127 Then
    WindowsMediaPlayer2.Controls.stop
    WindowsMediaPlayer2.URL = "C:\TICK2.wav"
    WindowsMediaPlayer2.Controls.play
ElseIf z = 145 Then
    WindowsMediaPlayer2.Controls.stop
    WindowsMediaPlayer2.URL = "C:\TICK2.wav"
    WindowsMediaPlayer2.Controls.play
ElseIf z = 163 Then
    WindowsMediaPlayer2.Controls.stop
    WindowsMediaPlayer2.URL = "C:\TICK2.wav"
    WindowsMediaPlayer2.Controls.play
ElseIf z = 181 Then
    WindowsMediaPlayer2.Controls.stop
    WindowsMediaPlayer2.URL = "C:\TICK2.wav"
    WindowsMediaPlayer2.Controls.play
ElseIf z = 192 Then
    WindowsMediaPlayer1.URL = "C:\抢答音乐.mp3"
    WindowsMediaPlayer1.Controls.play
ElseIf z = 197 Then
    WindowsMediaPlayer2.Controls.stop
ElseIf z = 200 Then
    Timer1.Enabled = False
    Label4 = ""
    Label5 = ""
    Label6 = "很遗憾 没有队伍申请回答"
    Command2.SetFocus
End If
End Sub



⌨️ 快捷键说明

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