Click here to Skip to main content
12,881,824 members (30,051 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB VB.NET
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:
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 20-Nov-11 23:00pm
Updated 20-Nov-11 23:05pm
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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

That should help
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

I don't really understand but here is a method that will take two strings and tell you if they are equal

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

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

    Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170422.1 | Last Updated 21 Nov 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100