📄 password.frm
字号:
VERSION 5.00
Begin VB.Form frmPassword
BorderStyle = 4 'Fixed ToolWindow
Caption = "密码"
ClientHeight = 1875
ClientLeft = 45
ClientTop = 285
ClientWidth = 2895
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1875
ScaleWidth = 2895
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
Height = 375
Left = 1560
TabIndex = 5
Top = 1320
Width = 975
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Default = -1 'True
Height = 375
Left = 360
TabIndex = 4
Top = 1320
Width = 975
End
Begin VB.TextBox txtPwd
Height = 270
Index = 1
Left = 1200
TabIndex = 2
Top = 765
Width = 1455
End
Begin VB.TextBox txtPwd
Height = 270
Index = 0
Left = 1200
TabIndex = 0
Top = 165
Width = 1455
End
Begin VB.Label lblPwd
AutoSize = -1 'True
Caption = "确认密码:"
Height = 180
Index = 1
Left = 240
TabIndex = 3
Top = 810
Width = 810
End
Begin VB.Label lblPwd
AutoSize = -1 'True
Caption = "输入密码:"
Height = 180
Index = 0
Left = 240
TabIndex = 1
Top = 210
Width = 810
End
End
Attribute VB_Name = "frmPassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdCancel_Click()
'将密码框赋空,表示不改变密码。
txtPwd(0) = ""
Me.Hide
End Sub
Private Sub cmdOK_Click()
'判断密码的有效性(两次密码要一致,而且密码不能为空)
If txtPwd(0) <> txtPwd(1) Then
MsgBox "两次密码输入的结果不一致!请重新输入", vbCritical, "错误"
ElseIf txtPwd(0) = "" Then
MsgBox "密码不能为空!", vbCritical, "错误"
Else
Me.Hide
End If
End Sub
Private Sub Form_Load()
txtPwd(0).PasswordChar = "*"
txtPwd(1).PasswordChar = "*"
txtPwd(0) = ""
txtPwd(1) = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -