level 3
啊嘞想做拔牙酱
楼主
Public mima As String
Dim s As String
Dim q As String
Private Sub form1_load()
mima = "111111"
End Sub
Private Sub Form_Unload(Cancel As Integer)
If MsgBox("是否退出程序?", vbQuestion + vbYesNo, "提示") = vbNo Then
Cancel = True
End If
End Sub Private Sub 密码框_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then
KeyAscii = 8
Exit Sub
End If
If KeyAscii < 47 Or KeyAscii > 58 Then
KeyAscii = 0
End If
End Sub Private Sub 清空键_Click()
If 密码框.Text <> "" Then
密码框.Text = ""
End If
End Sub Private Sub 确定键_Click()
If 密码框.Text = mima Then
q = MsgBox("欢迎光临", 0 + 64, "登录成功")
Form2.Show
Else
s = MsgBox("您的输入有误,请重新输入", 5 + 16, "密码校验框")
If s = vbCancel Then
End
Else
密码框.Text = ""
End If
End If
End Sub
为什么我输入111111就错误,不输直接点确定就执行?
2012年10月29日 13点10分
1
Dim s As String
Dim q As String
Private Sub form1_load()
mima = "111111"
End Sub
Private Sub Form_Unload(Cancel As Integer)
If MsgBox("是否退出程序?", vbQuestion + vbYesNo, "提示") = vbNo Then
Cancel = True
End If
End Sub Private Sub 密码框_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then
KeyAscii = 8
Exit Sub
End If
If KeyAscii < 47 Or KeyAscii > 58 Then
KeyAscii = 0
End If
End Sub Private Sub 清空键_Click()
If 密码框.Text <> "" Then
密码框.Text = ""
End If
End Sub Private Sub 确定键_Click()
If 密码框.Text = mima Then
q = MsgBox("欢迎光临", 0 + 64, "登录成功")
Form2.Show
Else
s = MsgBox("您的输入有误,请重新输入", 5 + 16, "密码校验框")
If s = vbCancel Then
End
Else
密码框.Text = ""
End If
End If
End Sub
为什么我输入111111就错误,不输直接点确定就执行?