Masks in a TextBox

jeva39

Well-known member
Joined
Jan 28, 2005
Messages
135
Location
Panama
Programming Experience
1-3
In a VB.NET form is possible to define a mask for entering data in a TextBox, for example, a Phone Number (507) 2174970 or a specific Date format? Please, how I can do this?

Thanks in advanced
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
awsome to hear that, i also heard that the framework v2.0 has a masked edit box but i've never played with the beta versions of VS.Net 2005
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,322
Location
Sydney, Australia
Programming Experience
10+
I use the old ActiveX masked edit control that ships with VS.NET. You can add it to your toolbox by selecting Add/Remove Items, then find Microsoft Masked Edit Control on the COM Components tab. I'll bet a lot of the third party alternatives are better or easier to use though. .NET 2.0 does have a good Masked Edit Control, but the issue is that you must apply a fixed-length mask. There is no support for regular expressions so each character in the mask corresponds to one character in the text.
 
Top Bottom