Private Sub CommandButton1_Click()
If TextBox1.Text = "" Then
MsgBox "用户名不能为空"
Exit Sub
ElseIf TextBox2.Text = "" Then
MsgBox "密码不能为空"
Exit Sub
End If
If TextBox1.Text = "杨晓凤" And TextBox2.Text = "072607" Then
MsgBox "登录成功"
Exit Sub
End If
If TextBox1.Text <> "" Or TextBox2.Text <> "" Then
MsgBox "输入用户名或密码错误,请重新输入!"
End If
End Sub
Private Sub CommandButton2_Click()
TextBox1.Text = ""
TextBox2.Text = ""
End Sub
Private Sub UserForm_initialize()
TextBox2.PasswordChar = "*"
End Sub
Private Sub CommandButton1_Click()
If TextBox1.Text = "" Then
MsgBox "用户名不能为空"
Exit Sub
ElseIf TextBox2.Text = "" Then
MsgBox "密码不能为空"
Exit Sub
End If
If TextBox1.Text = "杨晓凤" And TextBox2.Text = "072607" Then
MsgBox "登录成功"
UserForm2.Show
Unload UserForm1
Exit Sub
End If
If TextBox1.Text <> "" Or TextBox2.Text <> "" Then
MsgBox "输入用户名或密码错误,请重新输入!"
End If
End Sub
Private Sub CommandButton2_Click()
TextBox1.Text = ""
TextBox2.Text = ""
End Sub
Private Sub UserForm_initialize()
TextBox2.PasswordChar = "*"
End Sub