
展开全部
Private Sub Command1_Click()
Static i As Integer
i = i + 1
If Text1.Text = "12345" Then
MsgBox "密码正确!"
Unload Me
Form2.Show
Else
Text1.Text = ""
If i = 3 Then
MsgBox "您已输错密码3次,程序退出"
End
Else
MsgBox "密码错误,请重新输入!"
Text1.SetFocus
End If
End If
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text1.PasswordChar = "*"
End Sub
Static i As Integer
i = i + 1
If Text1.Text = "12345" Then
MsgBox "密码正确!"
Unload Me
Form2.Show
Else
Text1.Text = ""
If i = 3 Then
MsgBox "您已输错密码3次,程序退出"
End
Else
MsgBox "密码错误,请重新输入!"
Text1.SetFocus
End If
End If
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text1.PasswordChar = "*"
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询