Extended WPF Toolkit™ Community Edition MaskedTextBox

maskedTextBox.jpg

The free Community Edition of the Exceed MaskedTextBox lets you define a mask for a textbox, such as parentheses for the area code of a phone number or dashes in between the three parts of a Social Security Number.

WPF Composites also provides two additional methods to make working with the MaskedTextBox control easier.

The first method AddFixedLengthMaskedTextBox may be called within BeginComposite . . . EndComposite. It lets you define a starting text value, a fixed length mask, a bool for whether to hide prompt characters on focus leaving the textbox, and a bool for whether to select all text when focus is set on the control.

Example:
.AddFixedLengthMaskedTextBox<Grid>(14, 1, "(219) 999-9999", "(000) 000-0000", true, true)

The second method GetTextFromFixedLengthMaskedTextBox lets you get the Text value from the Fixed Length Masked TextBox including both values and literals; for example, "(999) 999-9999".

Example:
//get text value from Masked Text Box control at row-column 14-1 in Composite (Border)
string result = thisComposite.GetTextFromFixedLengthMaskedTextBox<Grid>(14, 1);

Last edited May 26, 2014 at 3:58 AM by stagathome0069, version 5

Comments

No comments yet.