密码框.frm

来自「VB源码,是初学者的福因.让你很快掌握VB编程」· FRM 代码 · 共 47 行

FRM
47
字号
VERSION 5.00
Begin VB.Form Form2 
   Caption         =   "密码框"
   ClientHeight    =   1260
   ClientLeft      =   60
   ClientTop       =   390
   ClientWidth     =   3270
   LinkTopic       =   "Form2"
   ScaleHeight     =   1260
   ScaleWidth      =   3270
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text1 
      Height          =   390
      IMEMode         =   3  'DISABLE
      Left            =   720
      PasswordChar    =   "*"
      TabIndex        =   0
      Top             =   480
      Width           =   1455
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "请输入密码:"
      Height          =   180
      Left            =   120
      TabIndex        =   1
      Top             =   120
      Width           =   1080
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
  If KeyCode = 13 Then
    If Text1.Text = "123456" Then
       Form1.Show
       Unload Form2
    Else
       Text1.Text = ""
       Label1.Caption = "密码错误,请再次输入密码:"
    End If
  End If
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?