Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,

I would like to compare two text box values (like "CompareValidator" in ASP.NET ) in VB.NET.
It is a Windows Application.

For Example:
Password and Conform Password in the Create Login form.

Code:
VB
If txtPassword.Text = txtConformPassword.Text
    "Do Something"
end if

I would like a function usable in any form in my project.

So please how to achieve this ?

Thanks and Regards,
Lakshmi narayanan.S
Posted
Updated 20-Nov-11 23:05pm
v2

The .Net Framework already has several built in string comparer functions[^] .

That should help
 
Share this answer
 
I don't really understand but here is a method that will take two strings and tell you if they are equal

VB
Public Function IsPasswordsEqual(password1 As String, password2 As String) As Boolean
    If password1.Equals(password2) Then
        Return True
    End If

    Return False
End Function
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900