📄 frmexammain.frm
字号:
Top = 2160
Width = 5460
End
Begin VB.Label lblB
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "2"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 285
Left = 3015
TabIndex = 14
Top = 2565
Width = 5460
End
Begin VB.Label lblC
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "3"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 285
Left = 3015
TabIndex = 13
Top = 2970
Width = 5460
End
Begin VB.Label lblD
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "4"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 285
Left = 3015
TabIndex = 12
Top = 3375
Width = 5460
End
Begin VB.Label lblAnswer
Alignment = 2 'Center
BackColor = &H00FF8080&
BorderStyle = 1 'Fixed Single
Caption = "A"
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 420
Left = 4545
TabIndex = 11
Top = 3870
Width = 555
End
Begin VB.Label Label7
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "你选择的答案是:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 210
Left = 2790
TabIndex = 10
Top = 3960
Width = 1680
End
End
Attribute VB_Name = "frmExamChoose"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdA_Click()
lblAnswer.Caption = ""
lblAnswer.Caption = "A"
MSFlexGrid1.TextMatrix(Val(lblNum.Caption), 1) = lblAnswer.Caption
End Sub
Private Sub cmdB_Click()
lblAnswer.Caption = ""
lblAnswer.Caption = "B"
MSFlexGrid1.TextMatrix(Val(lblNum.Caption), 1) = lblAnswer.Caption
End Sub
Private Sub cmdC_Click()
lblAnswer.Caption = ""
lblAnswer.Caption = "C"
MSFlexGrid1.TextMatrix(Val(lblNum.Caption), 1) = lblAnswer.Caption
End Sub
Private Sub cmdD_Click()
lblAnswer.Caption = ""
lblAnswer.Caption = "D"
MSFlexGrid1.TextMatrix(Val(lblNum.Caption), 1) = lblAnswer.Caption
End Sub
Private Sub cmdEnd_Click()
lblAnswer.Caption = ""
End Sub
Private Sub cmdFrist_Click()
rstChoose.MoveFirst
With rstChoose
lblTitle.Caption = .Fields("题文")
lblA.Caption = .Fields("A")
lblB.Caption = .Fields("B")
lblC.Caption = .Fields("C")
lblD.Caption = .Fields("D")
End With
lblNum.Caption = 1
lblAnswer.Caption = MSFlexGrid1.TextMatrix(Val(lblNum.Caption), 1)
End Sub
Private Sub cmdLast_Click()
rstChoose.MoveLast
With rstChoose
lblTitle.Caption = .Fields("题文")
lblA.Caption = .Fields("A")
lblB.Caption = .Fields("B")
lblC.Caption = .Fields("C")
lblD.Caption = .Fields("D")
End With
lblNum.Caption = 10
lblAnswer.Caption = MSFlexGrid1.TextMatrix(Val(lblNum.Caption), 1)
End Sub
Private Sub cmdNext_Click()
rstChoose.MoveNext
If rstChoose.EOF Then
rstChoose.MoveLast
lblNum.Caption = 10
Exit Sub
End If
With rstChoose
lblTitle.Caption = .Fields("题文")
lblA.Caption = .Fields("A")
lblB.Caption = .Fields("B")
lblC.Caption = .Fields("C")
lblD.Caption = .Fields("D")
End With
lblNum.Caption = Val(lblNum.Caption) + 1
lblAnswer.Caption = MSFlexGrid1.TextMatrix(Val(lblNum.Caption), 1)
End Sub
Private Sub cmdPre_Click()
rstChoose.MovePrevious
If rstChoose.BOF Then
rstChoose.MoveFirst
lblNum.Caption = 1
Exit Sub
End If
With rstChoose
lblTitle.Caption = .Fields("题文")
lblA.Caption = .Fields("A")
lblB.Caption = .Fields("B")
lblC.Caption = .Fields("C")
lblD.Caption = .Fields("D")
End With
lblNum.Caption = Val(lblNum.Caption) - 1
lblAnswer.Caption = MSFlexGrid1.TextMatrix(Val(lblNum.Caption), 1)
End Sub
Private Sub cmdReturn_Click()
Dim i As Integer
For i = 1 To chooseNUM
strChoose(i) = MSFlexGrid1.TextMatrix(i, 1)
Next i
frmTime.lblTitle.Caption = "隐藏考试说明窗体"
frmExam.Show
Unload Me
End Sub
Private Sub Form_Load()
Dim strSQL As String
Dim i As Integer
With MSFlexGrid1
.AllowUserResizing = flexResizeColumns
.Cols = 2
.Rows = chooseNUM + 1
.FixedCols = 0
.TextMatrix(0, 0) = "题号"
.TextMatrix(0, 1) = "考生答案"
End With
For i = 1 To chooseNUM
MSFlexGrid1.TextMatrix(i, 0) = i
Next i
For i = 1 To chooseNUM
MSFlexGrid1.TextMatrix(i, 1) = strChoose(i)
Next i
lblAnswer.Caption = ""
lblNum.Caption = 1
If chooseFlag = True Then
rstChoose.Close
chooseFlag = False
End If
strSQL = "Select * from choose where 卷号=" & numEJH
rstChoose.Open strSQL, cnn, adOpenStatic, adLockOptimistic
chooseFlag = True
rstChoose.MoveFirst
i = 1
While Not rstChoose.EOF
If i <= chooseNUM Then
strChAn(i) = rstChoose.Fields("答案")
numChVa(i) = rstChoose.Fields("分值")
End If
rstChoose.MoveNext
i = i + 1
Wend
rstChoose.MoveFirst
With rstChoose
lblTitle.Caption = .Fields("题文")
lblA.Caption = .Fields("A")
lblB.Caption = .Fields("B")
lblC.Caption = .Fields("C")
lblD.Caption = .Fields("D")
End With
End Sub
Private Sub Form_Unload(Cancel As Integer)
cmdReturn_Click
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -