Question Stupid question need help

audio_uphoria

Active member
Joined
Jan 28, 2009
Messages
31
Programming Experience
Beginner
Hello, I'm new to vb and I need someone to tell me why this wont work....

VB.NET:
Public Class Form1

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

        text1 = TextBox1.Text
        text2 = TextBox2.Text

        If text1.ToLower() = text2.ToLower() Then
            Label1.Text = "Good job! It matches!"
        Else
             text1.ToLower <> Text2.ToLower Then
            Label1.Text = "Keep trying"
        End If


    End Sub
End Class


Can you tell me why that doesnt work and what I can do to make it work? Thanks
 
Change this line:
text1.ToLower <> Text2.ToLower Then
to this:
VB.NET:
'text1.ToLower <> Text2.ToLower Then
 
Ah, right before you posted that I was able to realize that you don't need to state if the variables dont equal because the else already assumes that. Thanks for your help.
 
Back
Top