The Brave Programmer - Blogging and coding
Not for the faint hearted
 

Blog Posts From The Brave Programmer

Minimize

The Masked Textbox Control Visual Studio C#.

Feb6

Written by:
2009/02/06 08:16 AM RssIcon

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:

  • Date
  • IP Address
  • SSN
  • Phone numbers
  • digits
  • decimal

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.

Masked Textbox property

What the user enters

What is Displayed

12 12/

124

12/04/

13

01/3

3

03/

34

03/04/

14

01/04/

1/

01/

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.

Tags:
Categories:
blog comments powered by Disqus
 
Blog Updates Via E-mail
 Blog Updates Via E-mail
Minimize

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

Print  
 

 

Latest Comments
 Latest Comments
Minimize
Powered by Disqus

Sign up with Disqus to enjoy a  surprise box of features

Print  
 
Blog Roll
 Blog Roll
Minimize
Print  
 
Categories
 Categories
Minimize
Print  
 
<h1>Search Blogs From The Brave Programmer</h1>
 

Search Blogs From The Brave Programmer

Minimize
Print  
 
Archive
 Archive
Minimize
Archive
<November 2017>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789
Monthly
Go
Print  
 
<h1>News Feeds (RSS)</h1>
 

News Feeds (RSS)

Minimize
Print  
 

Follow robertbravery on Twitter

Blog Engage Blog Forum and Blogging Community, Free Blog Submissions and Blog Traffic, Blog Directory, Article Submissions, Blog Traffic

View Robert Bravery's profile on LinkedIn

Mybyte

 

Robert - Find me on Bloggers.com

Tags
 Tags
Minimize
Print  
 
Contact Us Now
 Contact Us Now
Minimize
 

Email  us now or call us on 082-413-1420,  to host your website.

We design and develop websites. We develop websites that make a difference. We do Dotnetnuke Module development.

Web Masters Around The World
Power By Ringsurf
Print