VB 要求在文本框中输入的口令都以“*”显示。程序运行后,单击“校验口令”按钮,实现

如题所述

添加如下控件

运行如下图

代码如下

Private Sub Command1_Click()
    If Text1.Text = "ABC" Then
        MsgBox "正确"
    Else
        MsgBox "错误"
    End If
End Sub

Private Sub Form_Load()
    Label1.Caption = "请输入口令:"
    Text1.PasswordChar = "*"
    Text1 = ""
    Command1.Caption = "校验口令"
End Sub

温馨提示:答案为网友推荐,仅供参考
相似回答