高手看下我的VB程序哪里有错?

来源:百度知道 编辑:UC知道 时间:2024/06/07 01:45:04
请高手看下我哪个地方出错了,谢谢了!!!
Const PassWord As String = "12345"
Const MaxLogTimes As Integer = 3

Private Sub cmdCancel_Click()
Dim intMsgReturn As Integer '变量intMsgRrturn用于保存消息框的返回值
intMsgReturn = MsgBox( _
Prompt:="请确认是否真的要取消登陆,取消登陆将结束应用程序!", _
Buttons:="vbOKCancel + vbQuestion + vbDefaultButton2 + vbSystemModal, _
Title:= "取消登陆")
If intMsgReturn = vbOK Then
Unload frmLogon
End
End If
End Sub

Private Sub CmdOk_Click()
Dim strResult As String, strName As String, strPassWord As String
Dim blnPassWord As Boolean
Static intLogTimes As Integer
intLogTimes = intLogTimes + 1 '保存登陆次数
If intLogTimes > MaxLogTimes Then '验证是否超过允许的登陆次数!
MsgBox "你已经超过允许的登陆次数!" & vbCr & "应用程序将结束!", vbCritical
End '超过允许的登陆次数,显示提示信息,结束应用程序
Else
strName = txtName.Text: strPassWord = TxtPassWord.Te

intMsgReturn = MsgBox( _
Prompt:="请确认是否真的要取消登陆,取消登陆将结束应用程序!", _
Buttons:="vbOKCancel + vbQuestion + vbDefaultButton2 + vbSystemModal, _
Title:= "取消登陆")
改成:
intMsgReturn = MsgBox( _
"请确认是否真的要取消登陆,取消登陆将结束应用程序!", _
vbOKCancel + vbQuestion + vbDefaultButton2 + vbSystemModal, _
"取消登陆")