📄 frmxuanze.frm
字号:
Left = 150
TabIndex = 23
Top = 990
Width = 435
End
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "frmxuanze.frx":04C2
Height = 3045
Left = 240
TabIndex = 32
Top = 3510
Width = 7965
_ExtentX = 14049
_ExtentY = 5371
_Version = 393216
AllowUpdate = 0 'False
Enabled = -1 'True
HeadLines = 1
RowHeight = 15
FormatLocked = -1 'True
AllowDelete = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 6
BeginProperty Column00
DataField = "neirong"
Caption = "题目"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = "A"
Caption = "A选项"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column02
DataField = "B"
Caption = "B选项"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column03
DataField = "C"
Caption = "C选项"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column04
DataField = "D"
Caption = "D选项"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column05
DataField = "daan"
Caption = "答案"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
ScrollBars = 2
ScrollGroup = 2
BeginProperty Column00
Locked = -1 'True
ColumnWidth = 4020.095
EndProperty
BeginProperty Column01
ColumnWidth = 720
EndProperty
BeginProperty Column02
ColumnWidth = 794.835
EndProperty
BeginProperty Column03
ColumnWidth = 764.787
EndProperty
BeginProperty Column04
ColumnWidth = 675.213
EndProperty
BeginProperty Column05
ColumnWidth = 420.095
EndProperty
EndProperty
End
End
End
Attribute VB_Name = "frmxuanze"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public presskey As String
Private Sub Combo1_Click()
presskey = "换表"
If Combo1.ListIndex = -1 Then
Combo1.ListIndex = 0
End If
Dim linkku As String
linkku = "xuanze" + Trim(Str(Combo1.ListIndex + 1))
adodc1.RecordSource = linkku
adodc1.Refresh
If Combo1.ListIndex > 1 Then
Frame3.Caption = "程序设计选择...难度" + Trim(Str(Combo1.ListIndex - 1))
Text8.DataField = "addneirong"
Else
Frame3.Caption = "基础选择...难度" + Trim(Str(Combo1.ListIndex + 1))
Text8.DataField = ""
End If
recordc1 = adodc1.Recordset.RecordCount
If recordc1 <> 0 Then
recordnum11 = 1
stats = "当前记录:" + Str(recordnum11) + "/" + Str(recordc1) + " 浏览状态"
Else
recordnum11 = 0
stats = "当前记录:BOF/EOF (空库,无记录)"
End If
fMainForm.sbStatusBar.Panels(1).Text = stats
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
Combo1_Click
End Sub
Private Sub Combo3_KeyPress(KeyAscii As Integer)
If KeyAscii >= Asc("a") And KeyAscii <= Asc("d") And Command5.Enabled = True Then
KeyAscii = KeyAscii + Asc("A") - Asc("a")
End If
End Sub
Private Sub Combo3_LostFocus()
If Combo3.Text = "" Or Len(Combo3.Text) > 1 Then
MsgBox "答案不能为空,(A,B,C,D)", vbInformation, "提示"
Combo3.SetFocus
ElseIf Asc(Combo3.Text) > Asc("D") Or Asc(Combo3.Text) < Asc("A") Then
MsgBox "答案为A,B,C,D中的一个,其它无效", vbInformation, "提示"
Combo3.SetFocus
End If
End Sub
Private Sub Command1_Click()
Dim spos, lens, textlen As Integer
Dim te As String
spos = Text3.SelStart
lens = Text3.SelLength
textlen = Len(Text3.Text)
Text3.Text = Mid(Text3.Text, 1, spos) + "_" + Mid(Text3.Text, spos + lens + 1, textlen - spos - lens + 1)
Text3.SetFocus
Text3.SelStart = spos + 1
End Sub
Private Sub Command10_Click()
If recordnum11 = recordc1 Then
MsgBox "己到记录尾", vbInformation, "查询"
Else
For i = recordnum1 + 1 To recordc1
Command13_Click
lookfor
If find1 And find2 Then
Exit Sub
End If
If i = recordc1 Then
MsgBox "没有找到符合条件的记录!", vbInformation, "无此记录"
End If
Next i
End If
End Sub
Private Sub Command11_Click()
presskey = "移动"
If Text1.Text = "" Or recordc1 = 1 Then
Else
If recordc1 >= 1 Then
recordnum1 = 1
Else
recordnum1 = 0
End If
adodc1.Recordset.MoveFirst
End If
stats = "当前记录:" + Str(recordnum1) + "/" + Str(recordc1) + " 浏览状态"
fMainForm.sbStatusBar.Panels(1).Text = stats
End Sub
Private Sub Command12_Click()
presskey = "移动"
If Text1.Text = "" Or recordc1 = 1 Then
Else
recordnum1 = recordnum1 - 1
adodc1.Recordset.MovePrevious
If Text1.Text = "" Then
adodc1.Recordset.MoveNext
recordnum1 = recordnum1 + 1
End If
End If
stats = "当前记录:" + Str(recordnum1) + "/" + Str(recordc1) + " 浏览状态"
fMainForm.sbStatusBar.Panels(1).Text = stats
End Sub
Private Sub Command13_Click()
presskey = "移动"
If Text1.Text = "" Or recordc1 = 1 Then
Else
recordnum1 = recordnum1 + 1
adodc1.Recordset.MoveNext
If Text1.Text = "" Then
adodc1.Recordset.MovePrevious
recordnum1 = recordnum1 - 1
End If
End If
stats = "当前记录:" + Str(recordnum1) + "/" + Str(recordc1) + " 浏览状态"
fMainForm.sbStatusBar.Panels(1).Text = stats
End Sub
Private Sub Command14_Click()
presskey = "移动"
If Text1.Text = "" Or recordc1 = 1 Then
Else
recordnum1 = adodc1.Recordset.RecordCount
adodc1.Recordset.MoveLast
End If
stats = "当前记录:" + Str(recordnum1) + "/" + Str(recordc1) + " 浏览状态"
fMainForm.sbStatusBar.Panels(1).Text = stats
End Sub
Public Sub Command15_Click()
Dim biao As String
If Combo1.ListIndex = -1 Then
Combo1.ListIndex = 0
End If
biao = "yxuanze" + Trim(Str(Combo1.ListIndex + 5))
Adodc3.RecordSource = biao
Adodc3.Refresh
Adodc2.RecordSource = "select * from " + biao + " where " + "neirong= '" + Text1.Text + "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount = 0 And adodc1.Recordset.RecordCount > 0 Then
Adodc3.Recordset.AddNew
Adodc3.Recordset.Fields(0) = Text1.Text
For i = 1 To 4
Adodc3.Recordset.Fields(i) = Text2(i - 1).Text
Next i
Adodc3.Recordset.Fields(5) = Text4.Text
If Combo1.ListIndex > 1 Then
Adodc3.Recordset.Fields(6) = Text8.Text
End If
MsgBox "成功加入考题试卷中。", vbInformation, App.EXEName
Adodc3.Recordset.Update
Else
MsgBox "试卷中己有此题,或试图加入空记录!加入失败。", vbInformation, App.EXEName
End If
End Sub
Private Sub Command2_Click()
Command1_Click
Command1_Click
End Sub
Private Sub Command3_Click()
Command2_Click
Command2_Click
End Sub
Public Sub Command4_Click()
If Text3.Text = "" Or Text7(0).Text = "" Or Text7(1).Text = "" Or Text7(2).Text = "" Or Text7(3).Text = "" Then
MsgBox "题目或答案还有的未填写完整,请继续填写。", vbInformation, "无法更新"
Text3.SetFocus
Exit Sub
End If
For i = 0 To 2
For j = i + 1 To 3
If Text7(i).Text = Text7(j).Text Then
MsgBox "选项" + Chr(65 + i) + "和选项" + Chr(65 + j) + "重复。", vbInformation, App.EXEName
Text7(i).SetFocus
Exit Sub
End If
Next j
Next i
linkku = "xuanze" + Trim(Str(Combo1.ListIndex + 1))
If Combo1.ListIndex < 2 Then
Adodc4.RecordSource = "select * from " + linkku + " where neirong='" + Text3.Text + "'"
Else
Adodc4.RecordSource = "select * from " + linkku + " where neirong+addneirong='" + Text3.Text + "'"
End If
Adodc4.Refresh
If Adodc4.Recordset.RecordCount <> 0 And presskey = "添加" Then
MsgBox "该记录已经存在于数据库中,无法新添加", vbExclamation, App.EXEName
Command5_Click
Exit Sub
End If
Command6.Default = True
If presskey = "添加" Then
recordc1 = recordc1 + 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -