📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "密码输入框"
ClientHeight = 975
ClientLeft = 60
ClientTop = 345
ClientWidth = 4320
LinkTopic = "Form1"
ScaleHeight = 975
ScaleWidth = 4320
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 375
IMEMode = 3 'DISABLE
Left = 2160
MaxLength = 5
PasswordChar = "*"
TabIndex = 0
Top = 120
Width = 1215
End
Begin VB.Label Label1
Caption = "请输入五位数字密码:"
Height = 375
Left = 240
TabIndex = 1
Top = 120
Width = 1815
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim pa As Integer
If KeyAscii >= 33 Then
If KeyAscii <= vbKey9 And KeyAscii >= vbKey0 Then
Else '把KeyAscii设为0就是取消输 入。
KeyAscii = 0
MsgBox "请输入数字!"
End If
End If
If KeyAscii = 13 Then
pa = CInt(Text1.Text)
If pa = "12345" Then
MsgBox "密码输入正确!"
Else
MsgBox "密码输入错误,正确密码是12345"
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -