frmedit.frm
来自「随机选题软件」· FRM 代码 · 共 451 行
FRM
451 行
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Begin VB.Form FrmEdit
BorderStyle = 4 'Fixed ToolWindow
Caption = "系统维护"
ClientHeight = 6810
ClientLeft = 45
ClientTop = 315
ClientWidth = 9975
Icon = "FrmEdit.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6810
ScaleWidth = 9975
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin MSComDlg.CommonDialog CDg1
Left = 4560
Top = 6120
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Frame Frame3
Caption = "版面设置"
Height = 3015
Left = 6360
TabIndex = 20
Top = 2760
Width = 3255
Begin VB.CommandButton Command12
Caption = "取 消"
Height = 255
Left = 1800
TabIndex = 14
Top = 2520
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "确 定"
Height = 255
Left = 360
TabIndex = 13
Top = 2520
Width = 1215
End
Begin VB.CommandButton Command8
Caption = ">"
Height = 255
Left = 2760
TabIndex = 29
Top = 2040
Width = 255
End
Begin VB.TextBox Text6
Height = 270
Left = 360
TabIndex = 12
Top = 2040
Width = 2415
End
Begin VB.CommandButton Command7
Caption = ">"
Height = 255
Left = 2760
TabIndex = 27
Top = 1320
Width = 255
End
Begin VB.TextBox Text5
Height = 270
Left = 360
TabIndex = 11
Top = 1320
Width = 2415
End
Begin VB.CommandButton Command6
Caption = ">"
Height = 255
Left = 2760
TabIndex = 25
ToolTipText = "浏览..."
Top = 600
Width = 255
End
Begin VB.TextBox Text4
Height = 270
Left = 360
TabIndex = 10
Top = 600
Width = 2415
End
Begin VB.Label Label6
Caption = "退出窗口图案:"
Height = 255
Left = 360
TabIndex = 28
Top = 1800
Width = 1695
End
Begin VB.Label Label5
Caption = "显示字体颜色:"
Height = 255
Left = 240
TabIndex = 26
Top = 1080
Width = 1455
End
Begin VB.Label Label4
Caption = "窗口背景图案:"
Height = 255
Left = 240
TabIndex = 24
Top = 360
Width = 1455
End
End
Begin VB.CommandButton Command3
Caption = "返 回"
Height = 375
Left = 5760
TabIndex = 15
Top = 6240
Width = 2295
End
Begin VB.CommandButton Command2
Caption = "帮 助"
Height = 375
Left = 1560
TabIndex = 16
Top = 6240
Width = 2295
End
Begin VB.PictureBox Picture1
Height = 60
Left = 0
ScaleHeight = 0
ScaleWidth = 9915
TabIndex = 19
Top = 6000
Width = 9975
End
Begin VB.Frame Frame2
Caption = "用户设置"
Height = 2295
Left = 6360
TabIndex = 18
Top = 360
Width = 3255
Begin VB.CommandButton Command5
Caption = "取 消"
Height = 255
Left = 1800
TabIndex = 9
Top = 1800
Width = 1215
End
Begin VB.CommandButton Command4
Caption = "确 定"
Height = 255
Left = 360
TabIndex = 8
Top = 1800
Width = 1215
End
Begin VB.TextBox Text3
Height = 270
Left = 1560
TabIndex = 7
Top = 1320
Width = 1455
End
Begin VB.TextBox Text2
Height = 270
Left = 1560
TabIndex = 6
Top = 840
Width = 1455
End
Begin VB.TextBox Text1
Height = 270
Left = 1560
TabIndex = 5
Top = 360
Width = 1455
End
Begin VB.Label Label3
Caption = "请确认口令:"
Height = 255
Left = 240
TabIndex = 23
Top = 1380
Width = 1215
End
Begin VB.Label Label2
Caption = "请输入口令:"
Height = 255
Left = 240
TabIndex = 22
Top = 900
Width = 1215
End
Begin VB.Label Label1
Caption = "请输入用户名:"
Height = 255
Left = 240
TabIndex = 21
Top = 405
Width = 1455
End
End
Begin VB.Frame Frame1
Caption = "题库维护"
Height = 5415
Left = 360
TabIndex = 17
Top = 360
Width = 5775
Begin VB.TextBox Text14
Height = 270
Left = 1080
TabIndex = 37
Top = 4200
Width = 1215
End
Begin VB.TextBox Text13
Height = 270
Left = 1080
TabIndex = 36
Top = 3840
Width = 4215
End
Begin VB.TextBox Text12
Height = 270
Left = 1080
TabIndex = 35
Top = 3480
Width = 4215
End
Begin VB.TextBox Text11
Height = 270
Left = 1080
TabIndex = 34
Top = 3120
Width = 4215
End
Begin VB.TextBox Text10
Height = 270
Left = 1080
TabIndex = 33
Top = 2760
Width = 4215
End
Begin VB.TextBox Text9
Height = 270
Left = 1080
TabIndex = 32
Top = 2400
Width = 4215
End
Begin VB.CommandButton Command11
Caption = "编 辑"
Height = 375
Left = 3960
TabIndex = 4
Top = 4680
Width = 1335
End
Begin VB.CommandButton Command10
Caption = "取 消"
Height = 375
Left = 2160
TabIndex = 3
Top = 4680
Width = 1335
End
Begin VB.CommandButton Command9
Caption = "添 加"
Height = 375
Left = 360
TabIndex = 2
Top = 4680
Width = 1335
End
Begin VB.TextBox Text8
Height = 270
Left = 1080
MultiLine = -1 'True
TabIndex = 1
Top = 2040
Width = 4215
End
Begin VB.TextBox Text7
Height = 1455
Left = 1080
MultiLine = -1 'True
TabIndex = 0
Top = 480
Width = 4215
End
Begin VB.Label Label9
Caption = "正确答案"
Height = 255
Left = 240
TabIndex = 38
Top = 4200
Width = 855
End
Begin VB.Label Label8
Caption = "答案:"
Height = 255
Left = 360
TabIndex = 31
Top = 2040
Width = 495
End
Begin VB.Label Label7
Caption = "题目:"
Height = 255
Left = 360
TabIndex = 30
Top = 480
Width = 615
End
End
End
Attribute VB_Name = "FrmEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Bmp, Bmpt As String, Cl As Double
Dim DB As Database
Dim RS As Recordset
Private Sub Command1_Click()
On Error Resume Next
Set DB = OpenDatabase(App.Path & "\maindb.mdb")
Set RS = DB.OpenRecordset("shezhi")
If RS.RecordCount = 0 Then
RS.AddNew
RS.Fields("beijing") = Text4.Text
RS.Fields("yanse") = Text5.BackColor
RS.Fields("tuichu") = Text6.Text
RS.Update
Else
RS.Edit
RS.Fields("beijing") = Text4.Text
RS.Fields("yanse") = Text5.BackColor
RS.Fields("tuichu") = Text6.Text
RS.Update
End If
MsgBox "更改界面设置成功!", , "界面设置"
RS.Close
DB.Close
End Sub
Private Sub Command10_Click()
Text7.Text = ""
Text8.Text = ""
MsgBox "你已经取消了添加记录!", , "提示"
End Sub
Private Sub Command11_Click()
Me.Hide
Load FrmTiKu
FrmTiKu.Show
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Command4_Click()
On Error Resume Next
Set DB = OpenDatabase(App.Path & "\maindb.mdb")
Set RS = DB.OpenRecordset("shezhi")
If Text3.Text = Text2.Text Then
If RS.RecordCount = 0 Then
RS.AddNew
RS.Fields("yonghu") = Text1.Text
RS.Fields("kouling") = Text2.Text
RS.Update
Else
RS.Edit
RS.Fields("yonghu") = Text1.Text
RS.Fields("kouling") = Text2.Text
RS.Update
End If
MsgBox "更改用户设置成功!", , "用户设置"
Else
MsgBox "请确认你的口令!", , "用户设置"
End If
RS.Close
DB.Close
End Sub
Private Sub Command6_Click()
CDg1.ShowOpen
Bmp = CDg1.FileName
Text4.Text = Bmp
End Sub
Private Sub Command7_Click()
CDg1.ShowColor
Cl = CDg1.Color
Text5.BackColor = Cl
End Sub
Private Sub Command8_Click()
CDg1.ShowOpen
Bmpt = CDg1.FileName
Text6.Text = Bmpt
End Sub
Private Sub Command9_Click()
Set DB = OpenDatabase(App.Path & "\maindb.mdb")
Set RS = DB.OpenRecordset("tiku")
RS.AddNew
RS.Fields("timu") = Text7.Text
RS.Fields("daana") = Text8.Text
RS.Fields("daanb") = Text9.Text
RS.Fields("daanc") = Text10.Text
RS.Fields("daand") = Text11.Text
RS.Fields("daane") = Text12.Text
RS.Fields("daanf") = Text13.Text
RS.Fields("daan") = Text14.Text
RS.Fields("xuan") = False
RS.Update
RS.Close
DB.Close
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text7.SetFocus
End Sub
Private Sub Form_Load()
Dim lresult As Long
lresult = SetWindowPos(Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE)
End Sub
Private Sub Form_Unload(Cancel As Integer)
FrmMain.Enabled = True
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?