Click here to Skip to main content
15,913,055 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
public class IPAddressTextBox : RegExTextBox
        {
            public IPAddressTextBox()
            {
                InitializeComponent();
                this.ValidationExpression = @"^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$";
                this.ErrorMessage = "The IP address must be in the form of 111.111.111.111";
            }
        }




I have used this code for validating an IPaddress in my project and i have got an error as

"The type or namespace name "RegExTextBox" could not be found( are you using directive or an assembly reference)

i am not aware of this C# how to use..

[edit]Unchecked "Ignore HTML in text" option to let the "Code Block" work - in future try using the preview to check the formatting![/edit]
Posted
Updated 4-Apr-10 8:24am
v2

1 solution

Do you mean RegexTextBox: A Windows Control Library[^]? If so, then I assume you have downloaded teh source code, but not included it in your project.

Either add the relevant files to your project, and change the namespace to match, or add the files as a new project, to build a dll, and include a reference / using in your existing project.
 
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