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

📄 frmsetup.frm

📁 本论文以“计算机考试系统”的开发为背景
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmSetup 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "考试设置"
   ClientHeight    =   3075
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4860
   BeginProperty Font 
      Name            =   "宋体"
      Size            =   10.5
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3075
   ScaleWidth      =   4860
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command2 
      Caption         =   "返回"
      Height          =   465
      Left            =   2730
      TabIndex        =   4
      Top             =   2070
      Width           =   1335
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   465
      Left            =   780
      TabIndex        =   3
      Top             =   2070
      Width           =   1335
   End
   Begin VB.ComboBox Combo1 
      Height          =   330
      Left            =   2700
      Style           =   2  'Dropdown List
      TabIndex        =   2
      Top             =   870
      Width           =   1485
   End
   Begin VB.OptionButton Option2 
      Caption         =   "随机抽取试卷"
      Height          =   315
      Left            =   360
      TabIndex        =   1
      Top             =   1380
      Width           =   2205
   End
   Begin VB.OptionButton Option1 
      Caption         =   "统一使用相同的试卷"
      Height          =   375
      Left            =   360
      TabIndex        =   0
      Top             =   840
      Value           =   -1  'True
      Width           =   2325
   End
   Begin VB.Image Image1 
      Height          =   480
      Left            =   330
      Picture         =   "frmSetup.frx":0000
      Top             =   180
      Width           =   480
   End
End
Attribute VB_Name = "frmSetup"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click()
Dim rst As Recordset

    Set rst = New Recordset
    rst.ActiveConnection = pCN
    rst.Source = "select * from 系统设置"
    rst.CursorLocation = adUseClient
    rst.CursorType = adOpenStatic
    rst.LockType = adLockBatchOptimistic
    rst.Open
    If Option1.Value Then
        rst![考试套号] = Combo1.ItemData(Combo1.ListIndex)
    Else
        rst![考试套号] = 0
                        
    End If
    rst.UpdateBatch
    Set rst = Nothing
    MsgBox "题库设置成功了!", vbInformation
    Unload Me
End Sub

Private Sub Command2_Click()
    Unload Me
End Sub

Private Sub Form_Load()
    Call InitCmb
End Sub

''初始化套号
Private Sub InitCmb()
Dim i As Integer
Dim rst As Recordset
    Set rst = New Recordset
    
    rst.ActiveConnection = pCN
    rst.Source = "select * from 套号"
    rst.LockType = adLockBatchOptimistic
    rst.CursorLocation = adUseClient
    rst.CursorType = adOpenStatic
    rst.Open
    
    Combo1.Clear
    For i = 1 To rst.RecordCount
        Combo1.AddItem rst![套号名称]
        Combo1.ItemData(Combo1.ListCount - 1) = rst![ID]
        rst.MoveNext
    Next i
        
    Me.Combo1.ListIndex = 0
    
    Set rst = Nothing
    
End Sub

Private Sub Option1_Click()
    Combo1.Enabled = True
End Sub

Private Sub Option2_Click()
    Combo1.Enabled = False
End Sub

⌨️ 快捷键说明

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