📄 main_czysz.frm
字号:
VERSION 5.00
Begin VB.Form main_czysz
BackColor = &H00C0C0C0&
BorderStyle = 3 'Fixed Dialog
Caption = "用户添加"
ClientHeight = 3435
ClientLeft = 45
ClientTop = 330
ClientWidth = 5985
Icon = "main_czysz.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3435
ScaleWidth = 5985
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "D:\VB数据库开发实例解析\程序\宾馆客房管理系统\Kfgl.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 2160
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "qxsz"
Top = 3480
Visible = 0 'False
Width = 1140
End
Begin VB.CommandButton Command2
BackColor = &H00C0C0C0&
Caption = "取消"
Height = 375
Left = 2280
Style = 1 'Graphical
TabIndex = 7
Top = 2880
Width = 1575
End
Begin VB.CommandButton Command1
BackColor = &H00C0C0C0&
Caption = "确定"
Height = 375
Left = 240
Style = 1 'Graphical
TabIndex = 6
Top = 2880
Width = 1575
End
Begin VB.CommandButton Command3
BackColor = &H00C0C0C0&
Caption = "退出"
Height = 375
Left = 4200
Style = 1 'Graphical
TabIndex = 5
Top = 2880
Width = 1575
End
Begin VB.Frame Frame1
Height = 2625
Left = 120
TabIndex = 0
Top = 120
Width = 5745
Begin VB.ComboBox Combo1
Height = 300
ItemData = "main_czysz.frx":000C
Left = 1920
List = "main_czysz.frx":000E
TabIndex = 8
Text = "Combo1"
Top = 2040
Width = 2895
End
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
Height = 345
Left = 1920
TabIndex = 3
Top = 600
Width = 2880
End
Begin VB.TextBox Text2
BackColor = &H00FFFFFF&
Height = 345
IMEMode = 3 'DISABLE
Left = 1920
MaxLength = 6
TabIndex = 2
Top = 1080
Width = 2880
End
Begin VB.TextBox Text3
BackColor = &H00FFFFFF&
Height = 360
IMEMode = 3 'DISABLE
Left = 1920
MaxLength = 6
PasswordChar = "*"
TabIndex = 1
Top = 1560
Width = 2880
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "权限:"
Height = 180
Left = 600
TabIndex = 12
Top = 2040
Width = 540
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "密码确认:"
Height = 180
Left = 600
TabIndex = 11
Top = 1560
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "密码:"
Height = 180
Left = 600
TabIndex = 10
Top = 1080
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "姓名:"
Height = 180
Left = 600
TabIndex = 9
Top = 600
Width = 540
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "请输入操作员代号和密码"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 150
TabIndex = 4
Top = 210
Width = 5100
End
End
End
Attribute VB_Name = "main_czysz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Data1.DatabaseName = App.Path & "\KFGL.MDB" '自动识别数据库路径
Combo1.AddItem "管理员"
Combo1.AddItem "用户"
End Sub
Private Sub Form_Activate()
Text1.SetFocus
Combo1.Text = ""
End Sub
Private Sub Form_Unload(Cancel As Integer)
' main.Enabled = True
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text2.SetFocus '回车text2获得焦点
End Sub
Private Sub text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text3.SetFocus '回车text3获得焦点
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Command1.SetFocus '回车Command1获得焦点
End Sub
Private Sub Command1_Click()
'保存操作员及密码
If Text1.Text <> "" Then
If Text2.Text <> "" Then
If Combo1.Text <> "" Then
If Text2.Text = Text3.Text Then
Data1.Recordset.AddNew
Data1.Recordset.Fields("操作员") = Text1.Text
Data1.Recordset.Fields("密码") = Text2.Text
Data1.Recordset.Fields("角色名称") = Combo1.Text
Data1.Recordset.Update '更新记录
Data1.Refresh
Text1.Text = "": Text2.Text = "": Text3.Text = ""
MsgBox ("操作员设置成功!")
Else
MsgBox ("两次密码输入不相同")
End If
End If
End If
Else
MsgBox ("请输入操作员!")
End If
End Sub
Private Sub Command2_Click()
Text1.Text = "": Text2.Text = "": Text3.Text = ""
End Sub
Private Sub Command3_Click()
' main.Enabled = True
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -