📄 frm_xtgl_mmxg.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form Frm_Xtgl_Mmxg
Caption = "密码修改"
ClientHeight = 2865
ClientLeft = 60
ClientTop = 345
ClientWidth = 4560
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 2865
ScaleWidth = 4560
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Cmd_Exit
Caption = "退出"
Height = 350
Left = 3315
TabIndex = 12
Top = 2490
Width = 950
End
Begin VB.CommandButton Cmd_Ok
Caption = "确定"
Height = 350
Left = 2280
TabIndex = 11
Top = 2490
Width = 950
End
Begin VB.Frame Frame1
Height = 2355
Left = 45
TabIndex = 0
Top = 45
Width = 4485
Begin MSComctlLib.ImageCombo ImageCombo1
Height = 315
Left = 1425
TabIndex = 10
Top = 1770
Width = 2700
_ExtentX = 4763
_ExtentY = 556
_Version = 393216
ForeColor = -2147483640
BackColor = -2147483643
Text = "请选择用户头像"
ImageList = "Imt_Tx"
End
Begin VB.TextBox Txt1
Height = 330
IMEMode = 3 'DISABLE
Index = 2
Left = 1425
PasswordChar = "*"
TabIndex = 8
Top = 1395
Width = 2700
End
Begin VB.TextBox Txt1
Height = 330
IMEMode = 3 'DISABLE
Index = 1
Left = 1425
PasswordChar = "*"
TabIndex = 6
Top = 1020
Width = 2700
End
Begin VB.TextBox Txt1
Height = 330
IMEMode = 3 'DISABLE
Index = 0
Left = 1425
PasswordChar = "*"
TabIndex = 5
Top = 660
Width = 2700
End
Begin VB.ComboBox Cbx_Name
Height = 300
Left = 1425
TabIndex = 2
Text = "请选择操作员姓名"
Top = 300
Width = 2700
End
Begin VB.Label Label5
Caption = "选择头像"
Height = 225
Left = 180
TabIndex = 9
Top = 1815
Width = 840
End
Begin VB.Label Label4
Caption = "确认新密码"
Height = 285
Left = 135
TabIndex = 7
Top = 1440
Width = 1275
End
Begin VB.Label Label3
Caption = "输入新密码"
Height = 270
Left = 135
TabIndex = 4
Top = 1080
Width = 1095
End
Begin VB.Label Label2
Caption = "操作员原密码"
Height = 240
Left = 135
TabIndex = 3
Top = 720
Width = 1095
End
Begin VB.Label Label1
Caption = "操作员姓名"
Height = 210
Left = 150
TabIndex = 1
Top = 345
Width = 1035
End
End
Begin MSComctlLib.ImageList Imt_Tx
Left = 0
Top = 2250
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 20
ImageHeight = 20
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 10
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Xtgl_Mmxg.frx":0000
Key = "头像1"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Xtgl_Mmxg.frx":165A
Key = "头像2"
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Xtgl_Mmxg.frx":2CB4
Key = "头像3"
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Xtgl_Mmxg.frx":430E
Key = "头像4"
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Xtgl_Mmxg.frx":5968
Key = "头像5"
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Xtgl_Mmxg.frx":6FC2
Key = "头像6"
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Xtgl_Mmxg.frx":861C
Key = "头像7"
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Xtgl_Mmxg.frx":9C76
Key = "头像8"
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Xtgl_Mmxg.frx":B2D0
Key = "头像9"
EndProperty
BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Xtgl_Mmxg.frx":C92A
Key = "头像10"
EndProperty
EndProperty
End
End
Attribute VB_Name = "Frm_Xtgl_Mmxg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs1 As New ADODB.Recordset
Private Sub Cbx_Name_Click()
rs1.Open "select * from tb_user where user_Name ='" + Cbx_Name.Text + "'", cnn, adOpenKeyset
If rs1.RecordCount > 0 Then
ImageCombo1.Text = rs1.Fields("user_tx")
End If
rs1.Close
End Sub
Private Sub Cbx_Name_GotFocus()
Cbx_Name.BackColor = &HFFFF80
End Sub
Private Sub Cbx_Name_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Txt1(0).SetFocus
End Sub
Private Sub Cbx_Name_LostFocus()
Cbx_Name.BackColor = &HFFFFFF
End Sub
Private Sub Cmd_Exit_Click()
Unload Me
End Sub
Private Sub Cmd_Ok_Click()
'确定
If Txt1(0).Text = "" Then
MsgBox "请输入用户密码!", , "信息提示"
Txt1(0).SetFocus
Exit Sub
Else
rs1.Open "select * from tb_user where user_Name='" + Cbx_Name.Text + "'", cnn, adOpenKeyset
If rs1.RecordCount > 0 Then
If Txt1(0).Text <> rs1.Fields("user_mm") Then
MsgBox "您输入的密码有误,请确认后重新输入!", , "信息提示"
Exit Sub
End If
End If
rs1.Close
End If
If Txt1(1).Text = "" Then
MsgBox "请输入新密码", , "信息提示"
Txt1(1).SetFocus
Exit Sub
End If
If Txt1(2).Text = "" Then
MsgBox "请输入确认密码", , "信息提示"
Txt1(2).SetFocus
Exit Sub
End If
If Txt1(1).Text <> Txt1(2).Text Then
MsgBox "两次输入的密码不一致", , "信息提示"
Txt1(1).SetFocus
Exit Sub
End If
rs1.Open "select * from tb_user where user_Name='" + Cbx_Name.Text + "'", cnn, adOpenKeyset
If rs1.RecordCount > 0 Then
cnn.Execute ("update tb_user set user_mm='" + Txt1(1).Text + "' where user_name='" + Cbx_Name + "'")
MsgBox "密码修改成功", , "信息提示"
End If
rs1.Close
For i = 0 To 2
Txt1(i).Text = ""
Next i
Cbx_Name.Text = "请选择操作员姓名"
ImageCombo1.Text = ""
End Sub
Private Sub Form_Load()
Dim NewItem As ComboItem '声明一个ComboItem对象
Dim i As Integer '声明一个整型变量
For i = 1 To 10
'向ImageCombo控件中添加图片
Set NewItem = ImageCombo1.ComboItems.Add(i, "头像" & i, "头像" & i, "头像" & i)
Next i
rs1.Open "select * from tb_user ", cnn, adOpenKeyset
If rs1.RecordCount > 0 Then
For i = 0 To rs1.RecordCount - 1
'向ComboBox中添加数据项
Cbx_Name.AddItem Trim(rs1.Fields("user_name"))
rs1.MoveNext
Next i
End If
rs1.Close
End Sub
Private Sub Form_Unload(Cancel As Integer)
Frm_Main.Enabled = True
End Sub
Private Sub ImageCombo1_GotFocus()
ImageCombo1.BackColor = &HFFFF80
End Sub
Private Sub ImageCombo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Cmd_Ok.SetFocus
End Sub
Private Sub ImageCombo1_LostFocus()
ImageCombo1.BackColor = &HFFFFFF
End Sub
Private Sub Txt1_GotFocus(Index As Integer)
Txt1(Index).BackColor = &HFFFF80
End Sub
Private Sub Txt1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
If Index = 2 Then
ImageCombo1.SetFocus
Exit Sub
End If
Txt1(Index + 1).SetFocus
End If
End Sub
Private Sub Txt1_LostFocus(Index As Integer)
Txt1(Index).BackColor = &HFFFFFF
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -