请指教

来源:互联网 发布:网络恐怖主义的兴起 编辑:程序博客网 时间:2024/04/20 22:56

练习中编写了下面一个小程序,但运行时总让调试红字部分,不知为什么?请高手们指点一二。谢谢


Private Sub cmdexit_Click()
End
End Sub

Private Sub cmdlog_Click()
 If Txt1.Text = "zhangsan" Then
     If Txt2.Text = "123456" Then
     Lbl3.Caption = "欢迎合法用户张三登陆"
   Else
     Lbl3.Caption = "口令错误,拒绝登陆"
     Form1.Tag = Form1.Tag + 1
   End If
 ElseIf Txt1.Text = "lisi" Then
   If Txt2.Text = "654321" Then
      Lbl3.Caption = "欢迎合法用户李四登陆"
   Else
      Lbl3.Caption = "口令错误,拒绝登陆"
  
   End If
 Else
      Lbl3.Caption = "用户名不存在,拒绝登陆"
End If
If Form1.Tag = 3 Then
   Lbl3.Caption = "错误次数超限,拒绝登陆。请单击“退出“按钮"
   cmdlog.Enabled = False
  End If
 End Sub

Private Sub Form_Load()
lbl1.Caption = "输入用户名:"
lbl2.Caption = "输入口令:"
cmdlog.Caption = "登陆"
cmdexit.Caption = "退出"
Txt1.Text = ""
Txt2.Text = ""
Lbl3.Caption = ""
cmdlog.Default = True
cmdexit.Cancel = True
End Sub