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

📄 frmmain.frm

📁 VB开发的考试系统,找了好久,希望有帮助,大家看看啊
💻 FRM
📖 第 1 页 / 共 2 页
字号:
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
            EndProperty
            BeginProperty Column01 
            EndProperty
         EndProperty
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "卷号:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   180
         Left            =   4410
         TabIndex        =   18
         Top             =   4147
         Width           =   540
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "考生试卷↓:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   180
         Left            =   360
         TabIndex        =   9
         Top             =   4455
         Width           =   990
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "程度:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   180
         Left            =   225
         TabIndex        =   5
         Top             =   4140
         Width           =   450
      End
      Begin VB.Label lblTitle 
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "题文"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF0000&
         Height          =   690
         Left            =   315
         TabIndex        =   3
         Top             =   3105
         Width           =   10770
      End
   End
   Begin MSComctlLib.StatusBar StatusBar1 
      Align           =   2  'Align Bottom
      Height          =   420
      Left            =   0
      TabIndex        =   0
      Top             =   7890
      Width           =   11880
      _ExtentX        =   20955
      _ExtentY        =   741
      Style           =   1
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
      EndProperty
   End
   Begin VB.Menu munGN 
      Caption         =   "系统功能(&G)"
      Begin VB.Menu Line1 
         Caption         =   "-"
      End
      Begin VB.Menu munPwd 
         Caption         =   "修改密码"
      End
      Begin VB.Menu munReturn 
         Caption         =   "返回登录"
      End
      Begin VB.Menu Line2 
         Caption         =   "-"
      End
      Begin VB.Menu munEnd 
         Caption         =   "退出"
         Shortcut        =   ^Q
      End
      Begin VB.Menu Line3 
         Caption         =   "-"
      End
   End
   Begin VB.Menu munModitfy 
      Caption         =   "题库维护(&M)"
      Begin VB.Menu munWrite 
         Caption         =   "试题录入"
      End
      Begin VB.Menu munFind 
         Caption         =   "试题检索"
      End
   End
   Begin VB.Menu munHelp 
      Caption         =   "帮助(&H)"
      Begin VB.Menu munStation 
         Caption         =   "系统说明..."
      End
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit


Private Sub cmdChange_Click()
cmdFind.Enabled = True
If chooseFlag = True Then
 rstChoose.Close
 chooseFlag = False
End If
If fillFlag = True Then
 rstFillBlank.Close
 fillFlag = False
End If

If cmdChange.Caption = "选择题" Then
  rstChoose.Open "Select 题号,程度,分值,题文,A,B,C,D,答案 from choose", cnn, adOpenStatic, adLockOptimistic
  chooseFlag = True
  Set DataGrid1.DataSource = rstChoose
  cmdChange.Caption = "填空题"
Else
  rstFillBlank.Open "Select 题号,程度,分值,题文,答案 from FillBlank", cnn, adOpenStatic, adLockOptimistic
  fillFlag = True
  Set DataGrid1.DataSource = rstFillBlank
  cmdChange.Caption = "选择题"
End If
  
End Sub

Private Sub cmdExam_Click()
If examFlag = True Then
 rstExamination.Close
 examFlag = False
End If
rstExamination.Open "Select 卷号,标号,题文,分值 from Examination", cnn, adOpenStatic, adLockOptimistic
examFlag = True
Set DataGrid2.DataSource = rstExamination

End Sub

Private Sub cmdFind_Click()
If chooseFlag = True Then
 rstChoose.Close
 chooseFlag = False
 rstChoose.Open "Select 程度,分值,题文,A,B,C,D,答案 from choose where 程度='" & Combo1.Text & "'", cnn, adOpenStatic, adLockOptimistic
 chooseFlag = True
 Set DataGrid1.DataSource = rstChoose

End If
If fillFlag = True Then
 rstFillBlank.Close
 fillFlag = False
 rstFillBlank.Open "Select 程度,分值,题文,答案 from FillBlank where 程度='" & Combo1.Text & "'", cnn, adOpenStatic, adLockOptimistic
 fillFlag = True
 Set DataGrid1.DataSource = rstFillBlank

End If
  
End Sub

Private Sub cmdFinish_Click()
Frame1.Visible = False
cmdFind.Enabled = False
If chooseFlag = True Then
 rstChoose.Close
 chooseFlag = False
End If
If fillFlag = True Then
 rstFillBlank.Close
 fillFlag = False
End If
If examFlag = True Then
  rstExamination.Close
  examFlag = False
End If
lblTitle.Caption = "题文"
End Sub

Private Sub cmdSelect_Click()
Dim maxE As Integer
Dim minE As Integer
Dim jhMax As Integer

If examFlag = True Then
 rstExamination.Close
 examFlag = False
End If
If txtJH.Text = "" Then
 MsgBox "请确定卷号!", , "提示"
 Exit Sub
End If

If examFlag = False Then
  rstExamination.Open "Select * from Examination", cnn, adOpenStatic, adLockOptimistic
  examFlag = True
End If
If chooseFlag = True Then
  numJH = txtJH.Text
  With rstExamination
   .AddNew
   .Fields("卷号") = Val(txtJH.Text)
   .Fields("标号") = "选"
   .Fields("题文") = rstChoose.Fields("题文")
   .Fields("分值") = rstChoose.Fields("分值")
   .Fields("题号") = rstChoose.Fields("题号")
   .Update
   .Close
   examFlag = False
  End With
  If examFlag = False Then
   rstExamination.Open "Select 卷号,标号,题文,分值 from Examination", cnn, adOpenStatic, adLockOptimistic
   Set DataGrid2.DataSource = rstExamination
  examFlag = True
  End If
End If

If fillFlag = True Then
  numJH = txtJH.Text
  With rstExamination
   .AddNew
   .Fields("卷号") = Val(txtJH.Text)
   .Fields("标号") = "填空"
   .Fields("题文") = rstFillBlank.Fields("题文")
   .Fields("分值") = rstFillBlank.Fields("分值")
   .Fields("题号") = rstFillBlank.Fields("题号")
   .Update
   .Close
   examFlag = False
  End With
  If examFlag = False Then
   rstExamination.Open "Select 卷号,标号,题文,分值 from Examination", cnn, adOpenStatic, adLockOptimistic
   Set DataGrid2.DataSource = rstExamination
  examFlag = True
  End If
End If
End Sub

Private Sub DataGrid1_Click()
If cmdChange.Caption = "填空题" Then
  lblTitle.Caption = rstChoose.Fields("题文")
Else
  lblTitle.Caption = rstFillBlank.Fields("题文")
End If

End Sub

Private Sub Form_Load()

Frame1.Visible = False
cmdFind.Enabled = False
Combo1.Clear
Combo1.AddItem "易"
Combo1.AddItem "中"
Combo1.AddItem "难"
Combo1.Text = "易"
End Sub

Private Sub munEnd_Click()
End
End Sub

Private Sub munFind_Click()
Frame1.Visible = True

End Sub

Private Sub munPwd_Click()
frmRePwd.Show 1

End Sub

Private Sub munReturn_Click()
frmInit.Show
Unload Me

End Sub

Private Sub munWrite_Click()
frmModity.Show 1

End Sub

Private Sub txtJH_Change()
If IsNumeric(txtJH.Text) = False And txtJH.Text <> "" Then
 MsgBox "只能输入数字!", , "提示"
 txtJH.SelStart = 0
 txtJH.SelLength = Len(txtJH.Text)
 txtJH.SetFocus
End If

End Sub

⌨️ 快捷键说明

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