
'添加好控件,把代码复制到窗体模块可以了吧。'label1,Label2,Text1'Command1:确定,command2:重输Private Sub Form_Load() Text1.PasswordChar = "*" Text1.MaxLength = 6 Command1.Enabled = False Command2.Visible = False Label2.Visible = FalseEnd SubPrivate Sub Command1_Click() If Text1.Text = "123456" Then Label2.ForeColor = vbBlue Label2.Caption = "欢迎进入应用程序!" Else Label2.ForeColor = vbRed Label2.Caption = "密码错误!"