vb窗体上有两个文本框:text1和text2,要求在文本框中输入用户名和登入密码。 单击“确定”做出判断。

2024-11-19 17:41:18
推荐回答(3个)
回答1:

private sub command1_click()
if text1.text="12345" and text2.text="12345" then
form2.show
else
msgbox “用户名不对,请重新输入!"
a=inputbox("请输入用户名")
print “黄莺登入,” & a
end if
end sub

回答2:

Private Sub command1_click()
If Text1.Text = "12345" And Text2.Text = "12345" Then
form2.Show
Form1.Hide
Else
MsgBox ("用户名不对,请重新输入!")
a = InputBox("请输入用户名")
Print "黄莺登入," & a
End If
End Sub

回答3:

If Text1 = "12345" And Text2 = "12345" Then
form2.Show
Else
MsgBox "用户名不对,请重新输入"
Form1.AutoRedraw = True
Print "黄莺登入," & InputBox("输入用户名")
End If