Click here to Skip to main content
15,889,863 members
Articles / Desktop Programming / WPF

International Phone Number Validation: Explained in Detail, Implemented with WPF TextBox

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
9 Apr 2020Public Domain7 min read 18.3K   6  
A WPF Textbox which can validate international and national phone numbers depending on your needs, plus detailed explanation of the structure of phone numbers.
Validating phone numbers is difficult, because the telephony authorities were too creative in how they used the limited available number range and because phone numbers look different in various countries. This article describes how phone number input validation can be reasonably done and provides a Control with production quality code, including letting the user enter only valid keystrokes, controlling if the phone number must be entered (required field) and alerting the user if he tries to close the window without saving the changes made. This control is part of the WpfWindowLib.

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under A Public Domain dedication


Written By
Software Developer (Senior)
Singapore Singapore
Retired SW Developer from Switzerland living in Singapore

Interested in WPF projects.

Comments and Discussions