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

📄 frmmodity.frm

📁 VB开发的考试系统,找了好久,希望有帮助,大家看看啊
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmModity 
   BackColor       =   &H000080FF&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "题库维护系统"
   ClientHeight    =   5385
   ClientLeft      =   2985
   ClientTop       =   2805
   ClientWidth     =   7035
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5385
   ScaleWidth      =   7035
   ShowInTaskbar   =   0   'False
   Begin MSComCtl2.UpDown UpDown1 
      Height          =   330
      Left            =   2835
      TabIndex        =   25
      Top             =   2340
      Width           =   240
      _ExtentX        =   423
      _ExtentY        =   582
      _Version        =   393216
      BuddyControl    =   "txtValue"
      BuddyDispid     =   196615
      OrigLeft        =   3000
      OrigTop         =   2280
      OrigRight       =   3240
      OrigBottom      =   2655
      SyncBuddy       =   -1  'True
      BuddyProperty   =   65547
      Enabled         =   -1  'True
   End
   Begin VB.Frame famControl 
      BackColor       =   &H000080FF&
      Height          =   690
      Left            =   90
      TabIndex        =   21
      Top             =   4680
      Width           =   6810
      Begin VB.CommandButton cmdEnd 
         Caption         =   "放   弃"
         Height          =   375
         Left            =   4590
         TabIndex        =   24
         Top             =   225
         Width           =   1545
      End
      Begin VB.CommandButton cmdReNew 
         Caption         =   "重   填"
         Height          =   375
         Left            =   2610
         TabIndex        =   23
         Top             =   225
         Width           =   1545
      End
      Begin VB.CommandButton cmdOK 
         Caption         =   "确   定"
         Height          =   375
         Left            =   585
         TabIndex        =   22
         Top             =   225
         Width           =   1545
      End
   End
   Begin VB.Frame famFillBlank 
      BackColor       =   &H000080FF&
      Caption         =   "填空题答案"
      Height          =   600
      Left            =   3285
      TabIndex        =   19
      Top             =   2115
      Width           =   3615
      Begin VB.TextBox txtFillAnswer 
         Height          =   270
         Left            =   180
         TabIndex        =   20
         Top             =   225
         Width           =   3345
      End
   End
   Begin VB.TextBox txtValue 
      Height          =   330
      Left            =   2520
      TabIndex        =   18
      Top             =   2340
      Width           =   315
   End
   Begin VB.Frame famChoose 
      BackColor       =   &H000080FF&
      Caption         =   "选择题答案选项"
      Height          =   1815
      Left            =   90
      TabIndex        =   4
      Top             =   2835
      Width           =   6810
      Begin VB.TextBox txtChooseAnswer 
         Height          =   375
         Left            =   6120
         TabIndex        =   26
         Top             =   1260
         Width           =   510
      End
      Begin VB.TextBox txtD 
         Height          =   330
         Left            =   540
         TabIndex        =   8
         Top             =   1350
         Width           =   5280
      End
      Begin VB.TextBox txtC 
         Height          =   330
         Left            =   540
         TabIndex        =   7
         Top             =   975
         Width           =   5280
      End
      Begin VB.TextBox txtB 
         Height          =   330
         Left            =   540
         TabIndex        =   6
         Top             =   600
         Width           =   5280
      End
      Begin VB.TextBox txtA 
         Height          =   330
         Left            =   540
         TabIndex        =   5
         Top             =   225
         Width           =   5280
      End
      Begin VB.Label Label9 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "答案"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9.75
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   195
         Left            =   6165
         TabIndex        =   27
         Top             =   990
         Width           =   435
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "D"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   180
         Left            =   225
         TabIndex        =   12
         Top             =   1425
         Width           =   120
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "C"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   180
         Left            =   225
         TabIndex        =   11
         Top             =   1050
         Width           =   120
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "B"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   180
         Left            =   225
         TabIndex        =   10
         Top             =   675
         Width           =   120
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "A"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   180
         Left            =   225
         TabIndex        =   9
         Top             =   300
         Width           =   120
      End
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      Left            =   1170
      TabIndex        =   2
      Text            =   "Combo1"
      Top             =   2340
      Width           =   780
   End
   Begin VB.TextBox txtTitle 
      Height          =   1140
      Left            =   135
      MultiLine       =   -1  'True
      TabIndex        =   0
      Top             =   945
      Width           =   6765
   End
   Begin VB.Frame Frame2 
      BackColor       =   &H000080FF&
      Height          =   600
      Left            =   90
      TabIndex        =   13
      Top             =   -45
      Width           =   6855
      Begin VB.OptionButton Option1 
         BackColor       =   &H000080FF&
         Caption         =   "选择题"
         Height          =   285
         Left            =   3870
         TabIndex        =   16
         Top             =   225
         Width           =   915
      End
      Begin VB.OptionButton Option2 
         BackColor       =   &H000080FF&
         Caption         =   "填空题"
         Height          =   330
         Left            =   5355
         TabIndex        =   15
         Top             =   225
         Width           =   915
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "请您确定您所要录入的题型"
         BeginProperty Font 
            Name            =   "仿宋_GB2312"
            Size            =   12
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   225
         TabIndex        =   14
         Top             =   225
         Width           =   3075
      End
   End
   Begin VB.Label Label8 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "分值:"
      Height          =   180
      Left            =   2025
      TabIndex        =   17
      Top             =   2400
      Width           =   540
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "试题的程度:"
      Height          =   180
      Left            =   135
      TabIndex        =   3
      Top             =   2400
      Width           =   1080
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "请输入题文:"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   225
      TabIndex        =   1
      Top             =   630
      Width           =   1905
   End
End
Attribute VB_Name = "frmModity"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strFlag As String
Dim nullFlag As Boolean

Private Sub cmdEnd_Click()

Unload Me
End Sub

Private Sub cmdOK_Click()
Dim numCjh As Integer
Dim numFjh As Integer

Call objNull
If nullFlag = True Then
 nullFlag = False
 Exit Sub
End If
If chooseFlag = True Then
 chooseFlag = False
 rstChoose.Close
End If
If fillFlag = True Then
 fillFlag = False
 rstFillBlank.Close
End If
If strFlag = "选" Then
 rstChoose.Open "Select * from choose", cnn, adOpenStatic, adLockOptimistic
 chooseFlag = True
 rstChoose.MoveLast
 numCjh = rstChoose.Fields("卷号")
 numflag = rstChoose.Fields("题号")
 numflag = numflag + 1
 If ((numflag - 1) Mod 10) = 0 Then
  numCjh = numCjh + 1
 End If
  rstChoose.AddNew
 With rstChoose
  .Fields("卷号") = numCjh
  .Fields("题文") = txtTitle.Text
  .Fields("标号") = strFlag
  .Fields("程度") = Combo1.Text
  .Fields("题号") = numflag
  .Fields("答案") = txtChooseAnswer.Text
  .Fields("分值") = Val(txtValue.Text)
  .Fields("A") = txtA.Text
  .Fields("B") = txtB.Text
  .Fields("C") = txtC.Text
  .Fields("D") = txtD.Text
  rstChoose.Update
  rstChoose.Close
End With
chooseFlag = False
End If
If strFlag = "填空" Then
 rstFillBlank.Open "Select * from FillBlank", cnn, adOpenStatic, adLockOptimistic
 fillFlag = True
 rstFillBlank.MoveLast
 numFjh = rstFillBlank.Fields("卷号")
 numflag = rstFillBlank.Fields("题号")
 numflag = numflag + 1
 If ((munflag - 1) Mod 5) = 0 Then
  numFjh = numFjh + 1
 End If
 rstFillBlank.AddNew
 With rstFillBlank
  .Fields("卷号") = numFjh
  .Fields("标号") = strFlag
  .Fields("题号") = numflag
  .Fields("程度") = Combo1.Text
  .Fields("题文") = txtTitle.Text
  .Fields("答案") = txtFillAnswer.Text
  .Fields("分值") = Val(txtValue.Text)
  .Update
  .Close
 End With
 fillFlag = False
End If
End Sub

Private Sub cmdReNew_Click()
Call objClear

End Sub

Private Sub Form_Load()
Option1.Value = False
Option2.Value = False
Me.Height = 975
Combo1.Clear
Combo1.AddItem "易"
Combo1.AddItem "中"
Combo1.AddItem "难"
txtValue.Text = 0

End Sub

Private Sub Option1_Click()
Me.Height = 5760
famControl.Top = 4680
famFillBlank.Visible = False
famChoose.Visible = True
strFlag = "选"
Call objClear

End Sub

Private Sub Option2_Click()
Me.Height = 3810
famControl.Top = 2745
famChoose.Visible = False
famFillBlank.Visible = True
strFlag = "填空"
Call objClear

End Sub

Private Sub txtValue_Change()
If IsNumeric(txtValue.Text) = False And txtValue.Text <> "" Then
 MsgBox "只能输入数字!", , "提示"
 txtValue.Text = ""
End If

End Sub

Private Sub objClear()
txtTitle.Text = ""
txtValue.Text = ""
txtFillAnswer.Text = ""
txtA.Text = ""
txtB.Text = ""
txtC.Text = ""
txtD.Text = ""
txtChooseAnswer.Text = ""

End Sub

Private Sub objNull()
If strFlag = "选" Then
 If txtTitle.Text = "" Or txtA.Text = "" Or txtB.Text = "" Or txtChooseAnswer.Text = "" _
    Or Combo1.Text = "" Or txtB.Text = "" Or txtC.Text = "" Or txtD.Text = "" Then
    nullFlag = True
    MsgBox "对话框中有空项!", , "提示"
 End If
End If
If strFlag = "填空" Then
 If txtTitle.Text = "" Or txtFillAnswer.Text = "" Or Combo1.Text = "" Then
  nullFlag = True
  MsgBox "对话框中有空项!", , "提示"
 End If
End If

End Sub

⌨️ 快捷键说明

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