Click here to Skip to main content
15,879,096 members
Articles / Programming Languages / Visual Basic
Article

VB.NET Maskedbox Control - Final Release

Rate me:
Please Sign up or sign in to vote.
4.12/5 (24 votes)
17 Jan 20031 min read 175.6K   1.8K   31   20
A very useful maskedbox control using vb.net

Sample Image - MaskedBox_Control.jpg

Introduction

VB.NET does not have a masked texbox and it's very important for user input. So I have made it myself because the components I have found is not good enough for me.

Details

  • The "#" character in the mask is used for digit only
  • The "&" character accepts letter or digit
  • Supported mask symbols are "-", ".", ",", "/", "\", ":"

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 maskedbox.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 valid characters

Ex. ##.###.####-###.###/###

History

  • Initial - I fixed a bug where the space key is not recognized. This version inherits a textbox component to publish all features of the textbox plus maskedbox
  • 20-jan-2003 Fixes - Function keys now are not handled by control. They cause an invalid character in between the text. The function SetText has been created. Programatically changing the text value in control din't change the masked text, so I created this function where the parameter is a string to fill the text (with no mask). If the text is "", then the text and mask is cleared with a empty mask.
  • 21-jan-2003 - The Final Release!!! I hope! Accept all characters and function keys. The delete key is working now !

Comments

Any comments ? Email me at pdvtech@terra.com.br. Visit my business site at www.pdvtech.com.br.

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


Written By
Web Developer
Brazil Brazil
Im a 48 years old and work developing applications since 14 years old

COBOL, my first language (i love)
BASIC, i born know

C#, Current passion !


Comments and Discussions

 
GeneralSuggested enhancements Pin
VBProEd31-Dec-05 8:45
VBProEd31-Dec-05 8:45 
JokeRe: Suggested enhancements Pin
RicardoPDV3-Jan-06 1:45
RicardoPDV3-Jan-06 1:45 

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

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