📄 frmmodipass.frm
字号:
VERSION 5.00
Object = "{CE671F01-259E-40DA-92FE-95803E2ECBB5}#1.0#0"; "SmartXPButton.ocx"
Begin VB.Form FrmModiPass
BackColor = &H00E7DFE7&
BorderStyle = 1 'Fixed Single
Caption = "修改密码"
ClientHeight = 3900
ClientLeft = 45
ClientTop = 330
ClientWidth = 4680
Icon = "FrmModiPass.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3900
ScaleWidth = 4680
Begin VB.TextBox txtNewPass1
Height = 375
IMEMode = 3 'DISABLE
Left = 1800
MaxLength = 10
PasswordChar = "*"
TabIndex = 7
Top = 2423
Width = 1695
End
Begin VB.TextBox txtNewPass
Height = 375
IMEMode = 3 'DISABLE
Left = 1800
MaxLength = 10
PasswordChar = "*"
TabIndex = 5
Top = 1763
Width = 1695
End
Begin VB.TextBox txtOldPass
Height = 375
IMEMode = 3 'DISABLE
Left = 1800
MaxLength = 10
PasswordChar = "*"
TabIndex = 3
Top = 1200
Width = 1695
End
Begin VB.TextBox txtUserName
BackColor = &H00E7DFE7&
Height = 375
Left = 1800
Locked = -1 'True
TabIndex = 10
TabStop = 0 'False
Top = 683
Width = 1695
End
Begin VB.TextBox txtUserId
Height = 375
Left = 1800
MaxLength = 10
TabIndex = 1
Top = 120
Width = 1695
End
Begin SmartXPButton.XpButton cmdOK
Height = 495
Left = 600
TabIndex = 8
Top = 3240
Width = 1335
_ExtentX = 2355
_ExtentY = 873
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
CaptionAreaPercent= 100
Caption = "确定(&O)"
CaptionMouseOverColor= 16711680
PictureSmoothBackColor= 14410727
End
Begin SmartXPButton.XpButton cmdExit
Height = 495
Left = 2280
TabIndex = 11
Top = 3240
Width = 1335
_ExtentX = 2355
_ExtentY = 873
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "关闭(&E)"
CaptionMouseOverColor= 16711680
PictureBackColor= 15790320
PictureSmoothBackColor= 15790320
ButtonPicture = "FrmModiPass.frx":1982
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "确认密码(&C)"
Height = 180
Left = 420
TabIndex = 6
Top = 2520
Width = 990
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "新密码(&N):"
Height = 180
Left = 420
TabIndex = 4
Top = 1860
Width = 990
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "旧密码(&P):"
Height = 180
Left = 420
TabIndex = 2
Top = 1320
Width = 990
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用户名:"
Height = 180
Left = 420
TabIndex = 9
Top = 780
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用户编号(&U):"
Height = 180
Left = 420
TabIndex = 0
Top = 240
Width = 1170
End
End
Attribute VB_Name = "FrmModiPass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Modipass As New OpenRs
Private Sub CmdExit_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
If txtUserid.Text = "" Then
MsgBox "请输入用户编号!", vbOKOnly + vbInformation, "修改密码"
txtUserid.SetFocus
Exit Sub
End If
If txtUsername.Text = "" Then
MsgBox "用户编号不存在!", vbOKOnly + vbInformation, "修改密码"
txtUserid.Text = ""
txtUserid.SetFocus
Exit Sub
End If
If txtOldPass.Text = "" Then
MsgBox "请输入旧密码!", vbOKOnly + vbInformation, "修改密码"
txtOldPass.SetFocus
Exit Sub
End If
If txtNewPass.Text = "" Then
MsgBox "请输入新密码!", vbOKOnly + vbInformation, "修改密码"
txtNewPass.SetFocus
Exit Sub
End If
If txtNewPass1.Text = "" Then
MsgBox "请输入新密码!", vbOKOnly + vbInformation, "修改密码"
txtNewPass1.SetFocus
Exit Sub
End If
If txtNewPass.Text = txtNewPass1.Text Then
Modipass.rs1!user_pwd = txtNewPass.Text
Modipass.rs1.Update
MsgBox "密码修改成功!", vbOKOnly + vbInformation, "修改密码"
txtUserid.Text = ""
txtUserid.SetFocus
Else
MsgBox "两次输入的密码不一致,请重新输入!", vbOKOnly + vbInformation, "修改密码"
txtNewPass.Text = ""
txtNewPass1.Text = ""
txtNewPass.SetFocus
End If
End Sub
Private Sub Form_Deactivate()
txtUserid.Text = ""
End Sub
Private Sub txtNewPass_GotFocus()
If txtOldPass.Text <> "" Then
If txtOldPass.Text <> Modipass.rs1!user_pwd Then
MsgBox "旧密码不正确!", vbOKOnly + vbInformation, "修改密码"
txtOldPass.Text = ""
txtOldPass.SetFocus
End If
Else
MsgBox "请输入旧密码!", vbOKOnly + vbInformation, "修改密码"
txtOldPass.SetFocus
Exit Sub
End If
End Sub
Private Sub txtNewPass_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Then
KeyAscii = 0
ElseIf KeyAscii = 13 Then
txtNewPass1.SetFocus
End If
End Sub
Private Sub txtNewPass1_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Then
KeyAscii = 0
ElseIf KeyAscii = 13 Then
Call cmdOK_Click
End If
End Sub
Private Sub txtOldPass_GotFocus()
If txtUserid.Text = "" Then
MsgBox "请输入用户编号!", vbOKOnly + vbInformation, "修改密码"
txtUserid.SetFocus
Exit Sub
End If
If txtUsername.Text = "" Then
MsgBox "用户编号不存在!", vbOKOnly + vbInformation, "修改密码"
txtUserid.Text = ""
txtUserid.SetFocus
End If
End Sub
Private Sub txtOldPass_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Then
KeyAscii = 0
ElseIf KeyAscii = 13 Then
txtNewPass.SetFocus
End If
End Sub
Private Sub txtUserId_Change()
txtUsername.Text = ""
txtOldPass.Text = ""
txtNewPass.Text = ""
txtNewPass1.Text = ""
End Sub
Private Sub txtUserId_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Then
KeyAscii = 0
ElseIf KeyAscii = 13 Then
txtOldPass.SetFocus
End If
End Sub
Private Sub txtUserId_LostFocus()
Modipass.rsDK1 "Select * from user_info where user_id='" & txtUserid.Text & "'"
If Modipass.rs1.EOF = False Then
txtUsername.Text = Modipass.rs1!user_name
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -