vb编程如何编 在线等
输入学号密码,密码三次输入不正确,在屏幕出现“错误”提示信息框。该信息框有两个按钮“重试”“取消”。点击“重试”按钮重新输入学号和密码,点击取消按钮退出程序...
输入学号密码,密码三次输入不正确,在屏幕出现“错误”提示信息框。该信息框有两个按钮“重试”“取消”。点击“重试 ”按钮重新输入学号和密码,点击 取消 按钮 退出程序
展开
2015-06-05
展开全部
Private Sub Command1_Click()
Static n As Integer
Dim i As Integer
If Text1.Text <> "username" And Text2.Text <> "password" Then
n = n + 1
If n >= 3 Then
i = MsgBox("错误", vbRetryCancel)
If i = vbCancel Then
Unload Me
Else
Text1.Text = ""
Text2.Text = ""
End If
Else
MsgBox "错误"
Text1.Text = ""
Text2.Text = ""
End If
End If
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Command1.Caption = "登录"
End Sub
Static n As Integer
Dim i As Integer
If Text1.Text <> "username" And Text2.Text <> "password" Then
n = n + 1
If n >= 3 Then
i = MsgBox("错误", vbRetryCancel)
If i = vbCancel Then
Unload Me
Else
Text1.Text = ""
Text2.Text = ""
End If
Else
MsgBox "错误"
Text1.Text = ""
Text2.Text = ""
End If
End If
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Command1.Caption = "登录"
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询