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

  • Thread starter Thread starter Bob
  • Start date Start date
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?
...
 
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.
 
* "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>
....
 
Back
Top