Written by:2009/02/06 08:16 AM
The TextBox control is the most used control in a Windows development. A lot of application problems are user related. Most of those are related to invalid input. Controling what and how the user can input data will help in QA as well as program and data flow. Using a masked control will save a lot of time for the developer and reduce the complaints and bugs.
This masked intelligent user control enhances the functionality of the normalTextBox control. The Mask can be set to any number of types or properties, namely:
The textbox control also checks the validation. It also automatically sets the delimiter location.
By default the property Masked is set to None and works like a normal TextBox control. In some builds of Visual Studio 2008 there is a type and spelling mistake. It is spelled 'Maked' as appose to 'Masked'.
If setting the property toDateOnly, the control is masked to Date format.
What the user enters
What is Displayed
You can also experiment with some of the other properties. Example, Phone numbers and decimals are probably the other widely used options. Especially here in South Africa where we have moved over to the 10 digit phone number. Putting a mask on your textbox will enforce your users to enter the correct phone number, including the area dialling codes.
0 comment(s) so far...
Do you want to receive blog updates via e-mail. Then just click on the link below. You will be redirected to Google's feed burner, where you can fill out a form. Supplying your e-mail address.
The subscription is managed entirely by Google's Feedburner. We cannot and do not collect your email address.
Subscribe to The Brave Programmer by Email
Sign up with Disqus to enjoy a surprise box of features