📄 frmtiku.frm
字号:
VERSION 5.00
Begin VB.Form FrmTiKu
BorderStyle = 4 'Fixed ToolWindow
Caption = "题库编辑"
ClientHeight = 6810
ClientLeft = 45
ClientTop = 315
ClientWidth = 9765
Icon = "FrmTiKu.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6810
ScaleWidth = 9765
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text8
Height = 375
Left = 1440
TabIndex = 21
Top = 4800
Width = 1455
End
Begin VB.TextBox Text7
Height = 375
Left = 960
TabIndex = 12
Top = 4200
Width = 7695
End
Begin VB.TextBox Text6
Height = 375
Left = 960
TabIndex = 11
Top = 3720
Width = 7695
End
Begin VB.TextBox Text5
Height = 375
Left = 960
TabIndex = 10
Top = 3240
Width = 7695
End
Begin VB.TextBox Text4
Height = 375
Left = 960
TabIndex = 9
Top = 2760
Width = 7695
End
Begin VB.TextBox Text3
Height = 375
Left = 960
TabIndex = 8
Top = 2280
Width = 7695
End
Begin VB.CommandButton Command4
Caption = "后一个"
Height = 375
Left = 6720
TabIndex = 6
Top = 6240
Width = 1575
End
Begin VB.CommandButton Command3
Caption = "修改"
Height = 375
Left = 4920
TabIndex = 5
Top = 6240
Width = 1575
End
Begin VB.CommandButton Command2
Caption = "删除"
Height = 375
Left = 3120
TabIndex = 4
Top = 6240
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "前一个"
Height = 375
Left = 1320
TabIndex = 3
Top = 6240
Width = 1575
End
Begin VB.TextBox Text2
Height = 375
Left = 960
TabIndex = 2
Top = 1800
Width = 7695
End
Begin VB.TextBox Text1
Height = 975
Left = 960
TabIndex = 1
Top = 480
Width = 7695
End
Begin VB.PictureBox Picture1
Height = 60
Left = 0
ScaleHeight = 0
ScaleWidth = 9675
TabIndex = 0
Top = 5880
Width = 9735
End
Begin VB.Label Label9
Caption = "正确答案"
Height = 255
Left = 480
TabIndex = 20
Top = 4920
Width = 855
End
Begin VB.Label Label8
Caption = "F"
Height = 255
Left = 600
TabIndex = 19
Top = 4320
Width = 255
End
Begin VB.Label Label7
Caption = "E"
Height = 255
Left = 600
TabIndex = 18
Top = 3720
Width = 255
End
Begin VB.Label Label6
Caption = "D"
Height = 255
Left = 600
TabIndex = 17
Top = 3240
Width = 255
End
Begin VB.Label Label5
Caption = "C"
Height = 255
Left = 600
TabIndex = 16
Top = 2880
Width = 255
End
Begin VB.Label Label4
Caption = "B"
Height = 255
Left = 600
TabIndex = 15
Top = 2400
Width = 255
End
Begin VB.Label Label3
Caption = "A"
Height = 255
Left = 600
TabIndex = 14
Top = 1920
Width = 255
End
Begin VB.Label Label2
Caption = "题目"
Height = 255
Left = 480
TabIndex = 13
Top = 480
Width = 495
End
Begin VB.Label Label1
Height = 255
Left = 3960
TabIndex = 7
Top = 5400
Width = 4695
End
End
Attribute VB_Name = "FrmTiKu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim DB As Database
Dim RS As Recordset
Private Sub Command1_Click()
On Error Resume Next
If Not RS.BOF Then
RS.MovePrevious
Text1.Text = RS.Fields("timu")
Text2.Text = RS.Fields("daan")
If RS.AbsolutePosition = -1 Then
Label1.Caption = "共有" & RS.RecordCount & "个记录" & " " & "已经是第一个记录"
Else
Label1.Caption = "共有" & RS.RecordCount & "个记录" & " " & "第" & RS.AbsolutePosition + 1 & "个记录"
End If
Else
MsgBox "已经是第一个记录!", , "错误提示"
End If
End Sub
Private Sub Command2_Click()
RS.Delete
End Sub
Private Sub Command3_Click()
If Command3.Caption = "修改" Then
Text1.Locked = False
Text2.Locked = False
Text3.Locked = False
Text4.Locked = False
Text5.Locked = False
Text6.Locked = False
Text7.Locked = False
Text8.Locked = False
Command1.Enabled = False
Command2.Enabled = False
Command4.Enabled = False
Command3.Caption = "更新"
Else
Text1.Locked = True
Text2.Locked = True
RS.Edit
RS.Fields("timu") = Text1.Text
RS.Fields("daan") = Text8.Text
RS.Fields("daana") = Text2.Text
RS.Fields("daanb") = Text3.Text
RS.Fields("daanc") = Text4.Text
RS.Fields("daand") = Text5.Text
RS.Fields("daane") = Text6.Text
RS.Fields("daanf") = Text7.Text
RS.Update
Command3.Caption = "修改"
Command1.Enabled = True
Command2.Enabled = True
Command4.Enabled = True
End If
End Sub
Private Sub Command4_Click()
On Error Resume Next
If Not RS.EOF Then
RS.MoveNext
Text1.Text = RS.Fields("timu")
Text2.Text = RS.Fields("daan")
If RS.AbsolutePosition = -1 Then
Label1.Caption = "共有" & RS.RecordCount & "个记录" & " " & "已经是最后一个记录"
Else
Label1.Caption = "共有" & RS.RecordCount & "个记录" & " " & "第" & RS.AbsolutePosition + 1 & "个记录"
End If
Else
MsgBox "已经是最后一个记录!", , "错误提示"
End If
End Sub
Private Sub Form_Load()
Set DB = OpenDatabase(App.Path & "\maindb.mdb")
Set RS = DB.OpenRecordset("select * from tiku order by id")
Text1.Locked = True
Text2.Locked = True
Text1.Text = RS.Fields("timu")
Text2.Text = RS.Fields("daan")
Label1.Caption = "共有" & RS.RecordCount & "个记录" & " " & "第1个记录"
End Sub
Private Sub Form_Unload(Cancel As Integer)
RS.Close
DB.Close
Load FrmEdit
FrmEdit.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -