?? manger.frm
字號:
VERSION 5.00
Begin VB.Form manger
BackColor = &H0080C0FF&
Caption = "操作員管理"
ClientHeight = 4710
ClientLeft = 2895
ClientTop = 1815
ClientWidth = 6375
ControlBox = 0 'False
LinkTopic = "Form1"
ScaleHeight = 4710
ScaleWidth = 6375
Begin VB.ComboBox Combo1
Height = 300
ItemData = "manger.frx":0000
Left = 2520
List = "manger.frx":000A
TabIndex = 2
Top = 2400
Width = 2055
End
Begin VB.TextBox txtselect
Appearance = 0 'Flat
Height = 270
Index = 0
Left = 1680
TabIndex = 9
Top = 360
Width = 1695
End
Begin VB.ComboBox comsel
Height = 300
Index = 0
ItemData = "manger.frx":0026
Left = 3600
List = "manger.frx":002D
TabIndex = 8
Text = "名字"
Top = 360
Width = 1215
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 270
Index = 3
Left = 2520
TabIndex = 3
Top = 3000
Width = 2055
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 270
IMEMode = 3 'DISABLE
Index = 1
Left = 2520
PasswordChar = "*"
TabIndex = 1
Top = 1800
Width = 2055
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 270
Index = 0
Left = 2520
TabIndex = 0
Top = 1200
Width = 2055
End
Begin VB.Label qd
BackStyle = 0 'Transparent
Caption = " 確定"
Height = 495
Left = 2760
MouseIcon = "manger.frx":0037
MousePointer = 99 'Custom
TabIndex = 12
Top = 4080
Width = 1455
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = " 返回"
Height = 540
Left = 4560
MouseIcon = "manger.frx":0341
MousePointer = 99 'Custom
TabIndex = 11
Top = 4080
Width = 1380
End
Begin VB.Image Image2
Height = 195
Index = 1
Left = 4680
MouseIcon = "manger.frx":064B
MousePointer = 99 'Custom
Picture = "manger.frx":0955
Top = 4080
Width = 195
End
Begin VB.Image Image1
Height = 450
Index = 1
Left = 4440
MouseIcon = "manger.frx":09D0
MousePointer = 99 'Custom
Picture = "manger.frx":0CDA
Stretch = -1 'True
Top = 3960
Width = 1395
End
Begin VB.Label Labinfo
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "查詢信息:"
Height = 180
Index = 1
Left = 720
TabIndex = 10
Top = 405
Width = 900
End
Begin VB.Image search
Height = 300
Index = 0
Left = 4920
MouseIcon = "manger.frx":110D
MousePointer = 99 'Custom
Picture = "manger.frx":1417
Top = 360
Width = 780
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "解屏密碼:"
Height = 180
Index = 3
Left = 1320
TabIndex = 7
Top = 3000
Width = 900
End
Begin VB.Image Image2
Height = 195
Index = 0
Left = 3000
MouseIcon = "manger.frx":1642
MousePointer = 99 'Custom
Picture = "manger.frx":194C
Top = 4080
Width = 195
End
Begin VB.Image Image1
Height = 450
Index = 0
Left = 2760
MouseIcon = "manger.frx":19C7
MousePointer = 99 'Custom
Picture = "manger.frx":1CD1
Stretch = -1 'True
Top = 3960
Width = 1395
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "管理員級別:"
Height = 180
Index = 2
Left = 1200
TabIndex = 6
Top = 2400
Width = 1080
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "管理員密碼:"
Height = 180
Index = 1
Left = 1200
TabIndex = 5
Top = 1800
Width = 1080
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "管理員姓名:"
Height = 180
Index = 0
Left = 1200
TabIndex = 4
Top = 1200
Width = 1080
End
Begin VB.Shape Shape1
BorderColor = &H0080FFFF&
BorderWidth = 5
Height = 4695
Left = 0
Top = 0
Width = 6375
End
End
Attribute VB_Name = "manger"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim yn As New yn '定義yn為yn類
Option Explicit
Private Sub Form_Load()
Select Case msg
Case Is = "添加管理員"
Me.qd.Caption = " 添加" '標題賦為
Me.txtselect(0).Locked = True '設置為不可寫
Me.txtselect(0).BackColor = &H80000004 '設置背景
Me.comsel(0).BackColor = &H80000004
Me.comsel(0).Locked = True
Case Is = "修改管理員"
Me.qd.Caption = " 修改"
Me.txtselect(0).Locked = False
Me.txtselect(0).BackColor = vbWhite
Me.comsel(0).BackColor = vbWhite
Me.comsel(0).Locked = False
Case Is = "刪除管理員"
Me.qd.Caption = " 刪除"
Me.txtselect(0).Locked = False
Me.txtselect(0).BackColor = vbWhite
Me.comsel(0).BackColor = vbWhite
Me.comsel(0).Locked = False
Me.Text1(0).BackColor = &H80000004
Me.Text1(1).BackColor = &H80000004
Me.Text1(3).BackColor = &H80000004
Me.Combo1.BackColor = &H80000004
Case Is = "管理員查詢"
Me.txtselect(0).Locked = False
Me.txtselect(0).BackColor = vbWhite
Me.comsel(0).BackColor = vbWhite
Me.comsel(0).Locked = False
Me.Text1(0).BackColor = &H80000004
Me.Text1(1).BackColor = &H80000004
Me.Text1(3).BackColor = &H80000004
Me.Combo1.BackColor = &H80000004
Me.Image1(0).Visible = False '設置不可見
Me.Image2(0).Visible = False
Me.qd.Visible = False
End Select
End Sub
Private Sub Label2_Click()
Unload Me '御下窗體
End Sub
Private Sub qd_Click()
Select Case msg
Case Is = "添加管理員"
If Me.Text1(0).Text <> "" And Me.Text1(1).Text <> "" And Me.Combo1.Text <> "" And Me.Text1(3).Text <> "" Then
Call yn.opendb("select * from 管理員 where 名字='" & Me.Text1(0).Text & "'") '查詢條件在數據庫中
If yn.myrec.EOF Then
Call yn.myrec.AddNew ' 添加
yn.myrec.Fields("名字") = Me.Text1(0).Text
yn.myrec.Fields("密碼") = Me.Text1(1).Text
yn.myrec.Fields("級別") = Me.Combo1.Text
yn.myrec.Fields("解屏密碼") = Me.Text1(3).Text
Call yn.myrec.Update '更新
Call yn.closedb '關閉
MsgBox "添加成功!!!", vbInformation
Me.Text1(0).Text = ""
Me.Text1(1).Text = ""
Me.Combo1.Text = ""
Me.Text1(3).Text = ""
Else
MsgBox "已經有此管理員!!!", vbInformation
Call yn.closedb
End If
Else
MsgBox "請輸入完整!!!", vbInformation
End If
Case Is = "修改管理員"
Call yn.opendb("select * from 管理員 where 名字='" & Me.txtselect(0).Text & "'")
If Not yn.myrec.EOF Then
yn.myrec.Fields("名字") = Me.Text1(0).Text
yn.myrec.Fields("密碼") = Me.Text1(1).Text
yn.myrec.Fields("級別") = Me.Combo1.Text
yn.myrec.Fields("解屏密碼") = Me.Text1(3).Text
Call yn.myrec.Update
Call yn.closedb
MsgBox "修改成功!!!", vbInformation
End If
Case Is = "刪除管理員"
Call yn.opendb("select * from 管理員 where 名字='" & Me.txtselect(0).Text & "'")
If Not yn.myrec.EOF Then
Me.Text1(0).Text = yn.myrec.Fields("名字")
Me.Text1(1).Text = yn.myrec.Fields("密碼")
Me.Combo1.Text = yn.myrec.Fields("級別")
Me.Text1(3).Text = yn.myrec.Fields("解屏密碼")
Call yn.myrec.Delete '刪除
Call yn.myrec.Update '更新
Call yn.closedb '關閉
MsgBox "刪除成功!!!", vbInformation
Me.Text1(0).Text = ""
Me.Text1(1).Text = ""
Me.Combo1.Text = ""
Me.Text1(3).Text = ""
End If
End Select
End Sub
Private Sub search_Click(Index As Integer)
Call yn.opendb("select * from 管理員 where 名字='" & Me.txtselect(0).Text & "'")
If Not yn.myrec.EOF Then
Me.Text1(0).Text = yn.myrec.Fields("名字")
Me.Text1(1).Text = yn.myrec.Fields("密碼")
Me.Combo1.Text = yn.myrec.Fields("級別")
Me.Text1(3).Text = yn.myrec.Fields("解屏密碼")
Call yn.closedb
Else
MsgBox "沒有此管理員!!!", vbInformation
Call yn.closedb
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -