Private Sub Form_Load()
txtPassword = ""
txtUsername = ""
txtPassword.MaxLength = 6
End Sub
Private Sub Label1_Click()
If txtUsername <> "txtUsername" Then
MsgBox "请输入正确用户名", vbInformation, "Err"
txtUsername = ""
Else
If txtPassword <> "123456" Then
MsgBox "密码输入错误", vbInformation, "Err"
txtPassword = ""
txtPassword.SetFocus
Else
MsgBox "登陆成功", vbInformation, "登陆成功"
End If
End If
End Sub
Private Sub Label2_Click()
End
End Sub