📄 frm_pwd.frm
字号:
VERSION 5.00
Begin VB.Form frm_PWD
BorderStyle = 1 'Fixed Single
Caption = "修改密码"
ClientHeight = 2505
ClientLeft = 4710
ClientTop = 3555
ClientWidth = 3750
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2505
ScaleWidth = 3750
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdEnd
Caption = "关闭"
Height = 375
Left = 2160
TabIndex = 8
Top = 2070
Width = 960
End
Begin VB.CommandButton cmdOk
Caption = "确定"
Height = 375
Left = 630
TabIndex = 7
Top = 2070
Width = 960
End
Begin VB.Frame Frame2
Caption = "请输入原始密码"
ForeColor = &H00000000&
Height = 735
Left = 45
TabIndex = 4
Top = 90
Width = 3660
Begin VB.TextBox txtOldPWD
ForeColor = &H00FF0000&
Height = 285
IMEMode = 3 'DISABLE
Left = 450
PasswordChar = "*"
TabIndex = 0
Top = 270
Width = 2670
End
End
Begin VB.Frame Frame1
ForeColor = &H00FF0000&
Height = 1095
Left = 45
TabIndex = 3
Top = 855
Width = 3660
Begin VB.TextBox txtPWD
BackColor = &H00FFFFFF&
ForeColor = &H00FF0000&
Height = 285
IMEMode = 3 'DISABLE
Left = 990
PasswordChar = "*"
TabIndex = 2
Top = 630
Width = 2265
End
Begin VB.TextBox txtNewPWD
BackColor = &H00FFFFFF&
ForeColor = &H00FF0000&
Height = 285
IMEMode = 3 'DISABLE
Left = 990
PasswordChar = "*"
TabIndex = 1
Top = 225
Width = 2265
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "确认密码"
ForeColor = &H00000000&
Height = 180
Left = 180
TabIndex = 6
Top = 675
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "新密码"
ForeColor = &H00000000&
Height = 180
Left = 180
TabIndex = 5
Top = 270
Width = 540
End
End
End
Attribute VB_Name = "frm_PWD"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdEnd_Click()
Unload Me
End Sub
Private Sub cmdOk_Click()
Dim rsR As New classCon
If Trim(txtNewPWD.Text) <> Trim(txtPWD.Text) Then
MsgBox "确认密码不符!", 48, "提示"
Exit Sub
Else
rsR.ModifyRecord strID, "密码", Trim(txtPWD.Text), "AdminInfo", "no"
MsgBox "修改成功!", , "提示"
Unload Me
End If
End Sub
Private Sub Form_Load()
txtOldPWD.Visible = True
txtNewPWD.BackColor = BCH
txtNewPWD.Enabled = False
txtPWD.BackColor = BCH
txtPWD.Enabled = False
cmdOK.Enabled = False
End Sub
Private Sub txtNewPWD_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtPWD.SetFocus
End If
End Sub
Private Sub txtOldPWD_Change()
If txtOldPWD.Text = strAPWD Then
txtNewPWD.Enabled = True
txtNewPWD.BackColor = BCW
txtPWD.Enabled = True
txtPWD.BackColor = BCW
cmdOK.Enabled = True
Else
txtNewPWD.Enabled = False
txtNewPWD.BackColor = BCH
txtPWD.Enabled = False
txtPWD.BackColor = BCH
cmdOK.Enabled = False
End If
End Sub
Private Sub txtOldPWD_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If txtOldPWD = strAPWD Then
txtNewPWD.Enabled = True
txtPWD.Enabled = True
cmdOK.Enabled = True
Else
MsgBox "你输入的密码不正确!", , "提示"
End If
End If
End Sub
Private Sub txtPWD_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdOk_Click
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -