VB代码-这个VB代码应该怎么写

[复制链接]
查看11 | 回复3 | 2008-9-7 03:23:31 | 显示全部楼层 |阅读模式
Private Sub Picture1_Click()
Dim a
If Text1.Text"" And Text2.Text"" Then
a = MsgBox("帐号未激活!", , "错误信息")
Else
a = MsgBox("帐号和密码不能为空!", , "错误信息")
End If
End Sub
Private Sub Picture2_Click()
Unload Me
Form2.Show
End Sub
Private Sub Text1_Change()
End Sub
我想加入在Text2中如果输入为:123456 点击就能弹出提示:验证成功
如果错误就弹出错误!!
问一下大家这样完整的代码是什么?。
必须结合上面完整的喔!。。没数据库的!

回复

使用道具 举报

千问 | 2008-9-7 03:23:31 | 显示全部楼层
Private Sub Picture1_Click() Dim a if Text2.Text"" Then
if Text2.Text ="123456" Then
a = MsgBox("严正成功, "提示信息")
else
a = MsgBox("密码错误!", , "错误信息")
end ifElse a = MsgBox("帐号和密码不能为空!", , "错误信息") End If End Sub Private Sub Picture2_Click() Unload Me Form2.Show End Sub Pr...
回复

使用道具 举报

千问 | 2008-9-7 03:23:31 | 显示全部楼层
Private Sub Text1_Change() if len(text2)=6 and text2="123456" thenmsgbox"验证成功"elseif len(text2)>=6 and text2"123456" thenmsgbox"错误"end ifEnd Sub...
回复

使用道具 举报

千问 | 2008-9-7 03:23:31 | 显示全部楼层
你的第二行的变量设置不完整....
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行