Skip to main content

MaskedTextBox

The Wisej.NET MaskedTextBox enhances the TextBox control with declarative input validation. The Mask property enables specifying:

  • Required input characters
  • Optional input characters
  • Input type expected at each mask position (digit, alphabetic, alphanumeric)
  • Mask literals (characters appearing directly in the MaskedTextBox, like hyphens in phone numbers or currency symbols)
  • Special character processing (e.g., converting to uppercase)

Features​

Preset Masks​

The custom mask property editor provides selection from predefined, commonly used masks.

MaskedTextBox mask property editor

Custom Error Handling​

The InvalidMessage property sets a tooltip message for invalid entries.

MaskedTextBox showing invalid input message

The TypeValidationCompleted event handler enables custom validation behavior.

MaskedTextBox with custom validation handling

Text Mask Format​

TextMaskFormat controls whether the Text value includes mask literals and prompt characters. Prompt characters excluded from the value are replaced with spaces.

  • ExcludePromptAndLiterals: Shows only user input text
  • IncludeLiterals: Shows user input and mask literal characters
  • IncludePrompt: Shows user input and prompt characters
  • IncludePromptAndLiterals: Shows user input, literal characters, and prompt characters

How To​

Customize the Appearance​

Customize text color using the ForeColor property.

Advanced​

JavaScript Widget​

ItemDescription
Class name"wisej.web.MaskedTextBox"
Theme Appearance"textbox"
Child components"textfield" is the inner <input> widget. See JavaScript
Toolcontainer state"editor", see Embedded Tools
Source codehttps://github.com/iceteagroup/wisej-js