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

I have wpf textbox in my form. I want a textbox that allows only numbers, characters and one or two special characters. Please help me regarding.


Thanks,
Narasima
Posted
Updated 27-May-10 4:39am
v2

This article is probably a good start:

Validation in Windows Presentation Foundation[^]

Also, try googling WPF validation.
 
Share this answer
 
v2
Try this:

C#
public static bool isNumber(string s)
        {
            int tmp;
            return int.TryParse(s, out tmp);
        }
 
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