O'Reilly logo

Microsoft® Visual Basic® .NET Programmer's Cookbook by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Use Masked Text Boxes

Problem

You want to have a fine-grained control over user text entry.

Solution

Use the masked ActiveX edit control, which can restrict and format data according to an input mask.

Discussion

The masked edit control looks like the text box control, but it includes enhancements for masked input and formatted output. If you don’t use an input mask, the masked edit control behaves like a standard text box.

To define an input mask, you set the Mask property with a string. The mask can include two types of characters: placeholders, which map to user supplied characters, and literal characters, which are entered automatically as the user types. The literal characters serve as visual cues that indicate the type of input that is being entered ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required