0

hi why does this prompt a wrong pass? plss help. :(

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        If TextBox1.Text = "Username" And TextBox2.Text = "Password Then" Then


        Me.Hide()
        Form2.Show()
    Else
        MsgBox("Wrong Username of Password.", vbExclamation, "Wrong")
    End If
3
Contributors
2
Replies
15
Views
3 Years
Discussion Span
Last Post by Deep Modi
0

this language is case sensitive,
so if you mispelled then it would be the one of the reason.

You may be mispelled here: Textbox1: "username" acyually "Username"
or on password: "password" instead of "Password then" or some here like this.
i thing by mistaken you haven't close the brackets and type the code and on hhint the VB.net complete your code so it becomes:
password then instead of password.

I used same coding example:

If Not textbox1.text = "username" and textbox2.text = "password" then
    messagebox.show("Oops, you have mispelled.")
Else
    Form2.show()
    me.close
End If
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.