📄 frmchangepwd.frm
字号:
VERSION 5.00
Begin VB.Form frmchangepwd
BorderStyle = 0 'None
Caption = "修改密码"
ClientHeight = 5325
ClientLeft = 0
ClientTop = -105
ClientWidth = 7005
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 5325
ScaleWidth = 7005
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.PictureBox Picture1
BorderStyle = 0 'None
Height = 5295
Left = 0
Picture = "frmchangepwd.frx":0000
ScaleHeight = 5295
ScaleWidth = 6975
TabIndex = 0
Top = 0
Width = 6975
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 3000
PasswordChar = "*"
TabIndex = 2
Top = 2640
Width = 2055
End
Begin VB.TextBox Text1
Height = 375
IMEMode = 3 'DISABLE
Left = 3000
PasswordChar = "*"
TabIndex = 1
Top = 1920
Width = 2055
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Height = 375
Left = 6360
MouseIcon = "frmchangepwd.frx":4B5A
MousePointer = 99 'Custom
TabIndex = 6
Top = 120
Width = 495
End
Begin VB.Label Commandcancel
BackStyle = 0 'Transparent
Height = 495
Index = 1
Left = 4080
MouseIcon = "frmchangepwd.frx":4CAC
MousePointer = 99 'Custom
TabIndex = 5
Top = 3840
Width = 975
End
Begin VB.Label Command2
BackStyle = 0 'Transparent
Height = 495
Index = 0
Left = 4200
TabIndex = 4
Top = 4080
Width = 1335
End
Begin VB.Label Command1
BackStyle = 0 'Transparent
Height = 495
Left = 1800
MouseIcon = "frmchangepwd.frx":4DFE
MousePointer = 99 'Custom
TabIndex = 3
Top = 3840
Width = 975
End
End
End
Attribute VB_Name = "frmchangepwd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Download by http://www.codefans.net
Option Explicit
Dim cnt As Integer '记录确定次数
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Const RGN_XOR = 3
Private Const HTCAPTION = 2
Private Const WM_NCLBUTTONDOWN = &HA1
Private Type RECT
left As Long
top As Long
right As Long
bottom As Long
End Type
Dim Xs As Long
Function CreatePictureform()
On Error Resume Next
Dim hRgn As Long, hRect As RECT, hTempRgn As Long, tColour As Long, OldScaleMode As Integer, AbsoluteX As Long, AbsoluteY As Long
Dim Color As Long, Hrect1 As RECT
Dim xx As Long, yy As Long
Dim rtn As Long
Me.Picture = Me.Picture1
Me.Width = Me.Picture1.Width
Me.Height = Me.Picture1.Height
OldScaleMode = Me.ScaleMode
Me.AutoRedraw = True
Me.ScaleMode = 3
Color = vbWhite
rtn = GetWindowRect(Me.hwnd, hRect)
hRgn = CreateRectRgn(0, 0, hRect.right, hRect.bottom)
For AbsoluteX = 0 To Me.ScaleWidth
For AbsoluteY = 0 To Me.ScaleHeight
tColour = GetPixel(Me.hdc, AbsoluteX, AbsoluteY)
If tColour = Color Then
hTempRgn = CreateRectRgn(AbsoluteX, AbsoluteY, AbsoluteX + 1, AbsoluteY + 1)
rtn = CombineRgn(hRgn, hRgn, hTempRgn, RGN_XOR)
rtn = DeleteObject(hTempRgn)
End If
Next AbsoluteY
Next AbsoluteX
rtn = SetWindowRgn(Me.hwnd, hRgn, True)
DeleteObject hRgn
Me.ScaleMode = OldScaleMode
If Err Then
MsgBox Error, 16, Err
End If
End Function
Private Sub Commandcancel_Click(Index As Integer)
Unload Me
Main.Show
End Sub
Private Sub Label1_Click()
Unload Me
Main.Show
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Dim ReturnVal As Long
Xs = ReleaseCapture()
ReturnVal = SendMessage(hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
End If
End Sub
Private Sub Command1_Click()
Dim rs_chang As New ADODB.Recordset
Dim sql As String
If Trim(Text1.Text) <> Trim(Text2.Text) Then
MsgBox "密码不一致!", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Else
sql = "select * from 系统管理 where 用户名='" & userID & "'"
rs_chang.Open sql, conn, adOpenKeyset, adLockPessimistic
rs_chang.Fields(1) = Text1.Text
rs_chang.Update
rs_chang.Close
MsgBox "密码修改成功", vbOKOnly + vbExclamation, ""
Unload Me
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Dim rs_chang As New ADODB.Recordset
Dim sql As String
If Trim(Text1.Text) <> Trim(Text2.Text) Then
MsgBox "密码不一致!", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Else
sql = "select * from 系统管理 where 用户名='" & userID & "'"
rs_chang.Open sql, conn, adOpenKeyset, adLockPessimistic
rs_chang.Fields(1) = Text1.Text
rs_chang.Update
rs_chang.Close
MsgBox "密码修改成功", vbOKOnly + vbExclamation, ""
Unload Me
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -