How do I mask the input of a Text Box in VB.NET

B

Bob

I am using a standard VB.NET Textbox to allow the user to
enter a SSN in a windows form which I submit to SQL
Server. I would like to mask the input so the format is of
999-99-9999 to limit bad data entry. Is there a way to do
this?
...
 
T

Tim Wilson

If you want a UI based mask as an indicator to the end-user then you will
need to create, or locate, a masked edit control. You should be able to find
some here:
http://www.codeproject.com/cs/miscctrl/#Edit+Controls

If you are ok with doing the validation yourself, for example when the user
clicks a button, then you would probably be best to use a Regular
Expression.
 
H

Herfried K. Wagner [MVP]

* "Bob said:
I am using a standard VB.NET Textbox to allow the user to
enter a SSN in a windows form which I submit to SQL
Server. I would like to mask the input so the format is of
999-99-9999 to limit bad data entry. Is there a way to do
this?

<URL:http://www.codeproject.com/cs/miscctrl/maskedcsedit.asp>
<URL:http://www.codeproject.com/vb/net/maskedbox_control.asp>
<URL:http://www.codeproject.com/vb/net/validtext3.asp>
<URL:http://www.codeproject.com/vb/net/cpflexmaskeditbox.asp>
<URL:http://www.codeproject.com/useritems/ValidText.asp>
....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Input of phone numbers 3
Input Mask query 3
Input Mask 1
Input mask/combo box/query problem 2
view format problem 2
Input Mask 1
Remove input mask format 4
input mask 2

Top