Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have a textbox that is used for naming something.I need to make it so it doesn't accept these characters / | \"" < > ? * . Any help is appreciated. I would like to make it that it doesn't even enter them into the tbox like windows 7 does but i dont Know how.Thanks In Advance!!

What I have tried:

i tried excluding them but if i enter more than one in it with letters in between it doesnt kick it out.
Posted
Updated 2-May-18 4:12am
v2
Comments
BillWoodruff 2-May-18 10:48am    
You can easily solve this problem using the recently posted code examples shown here:

https://www.codeproject.com/Answers/1241997/How-to-write-a-regular-expression-which-will-accep
Rob Philpott 2-May-18 12:32pm    
Yep. I like the keypress intercept - it's a classic!

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