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

来源:百度知道 编辑:UC知道 时间:2024/06/16 18:24:49
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 点击就能弹出提示:验证成功
如果错误就弹出错误!!

问一下大家这样完整的代码是什么?。

必须结合上面完整的喔!。。没数据库的!

Private Sub Text1_Change()
if len(text2)=6 and text2="123456" then
msgbox"验证成功"
elseif len(text2)>=6 and text2<>"123456" then
msgbox"错误"
end if
End Sub

Private Sub Picture1_Click()
Dim a
if Text2.Text <> "" Then

if Text2.Text ="123456" Then
a = MsgBox("严正成功, "提示信息")
else
a = MsgBox("密码错误!", , "错误信息")
end if
Else
a = MsgBox("帐号和密码不能为空!", , "错误信息")
End If
End Sub

Private Sub Picture2_Click()
Unload Me
Form2.Show
End Sub

Private Sub Text1_Change()

End Sub

你的第二行的变量设置不完整.