Click here to Skip to main content
Click here to Skip to main content

Masked Edit Box in vb.net

, 29 Oct 2004
Rate this:
Please Sign up or sign in to vote.
Simple but flexible Masked Edit Box
<!-- Article Starts - DO NOT ADD HTML/BODY START TAGS-->

Sample Image - MaskedTextBox.jpg

Introduction

This is a very easy to use Masked TextBox for fixed length strings like phone numbers, social security, driver license, etc. Not suitable for values as it is but you can customize it.

Details

  • The "#" character in the mask is used for digit only
  • The "&" character accepts letter only
  • The "!" character accepts letter or digit
  • You can use any mask symbol, letter and digit other than # & and !
Ex. ###-&!/&&(###) ###-!!!! &&XXX##Z12&&&

Using Component

The use of this component is very simple. You have to select the toolbox panel, right click in the windows forms section and select customize toolbox.

Select .NET framework components, then click browse and select maskedtextbox.dll in the download path. The maskedbox component will appear at the end of windows forms panel. Now select the component and drop it on a form.

Then set the mask property with any combination of characters

At run time you can read the unformatedtext property to read only the user input.

The Text property returns the formated string.

 

 

 

 

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Edu001

United States United States
No Biography provided

Comments and Discussions

 
GeneralMy vote of 1 PinmvpDave Kreskowiak2-Oct-09 9:38 
GeneralRead only PinmemberAJR 11217-May-06 11:17 
GeneralCauses exception Pinmemberingotaner25-Jan-06 5:54 
GeneralIt has wha I need PinmemberBe thankful2-May-05 5:42 
GeneralBad :( PinmemberAsaph3-Feb-05 11:45 
GeneralI am not getting this Masked Edit Box PinmemberManish Kauhsik12-Jan-05 20:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.141223.1 | Last Updated 29 Oct 2004
Article Copyright 2004 by Edu001
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid