A masked edit control for Windows Forms: an edit mask defines what can be entered at each position, digits, letters, characters from a list or numbers with digit grouping and ranges, with literals the user types over. Decimal, integer and hexadecimal numeric fields with up and down buttons, a popup calculator, autocomplete from earlier entries, files and folders, an ellipsis button, prompt characters, a label, colors for invalid contents, validation and conversion of the contents to a type. It covers all functions of the Windows Forms MaskedTextBox and NumericUpDown controls. Version 3.0 runs on the .NET Framework and on .NET 10, with Visual Studio designer support on both, and supports dark mode, per-monitor high-DPI scaling and screen readers.
SftMask/NET is a masked edit control for Windows Forms: an edit mask defines what can be entered at each position, digits, letters, characters from a list or numbers with digit grouping and ranges, with literals such as parentheses and dashes that the user types over. At home on .NET 10 and on modern Windows.
Numeric fields offer up and down buttons and a popup calculator, earlier entries, files and folders are suggested while the user types, and a label, prompt characters and colors show what is expected. It covers all functions of the Windows Forms MaskedTextBox and NumericUpDown controls. Version 3.0 runs on the .NET Framework and on .NET 10, with the Visual Studio designer on both.
Coming from the Windows Forms MaskedTextBox or NumericUpDown? See how they compare with SftMask/NET and where each of their functions is found.
(_)
Required and optional digits, letters, letters or digits and any characters, lists and ranges of allowed characters, with literals the user types over.
123
Decimal, integer and hexadecimal fields with digit grouping, negative numbers, leading zeros and ranges, several of them in one mask.
+=
Typing +, -, * or / into an amount opens a calculator at the field, with the numbers and operators entered so far on a tape above its entry line.
Ab
Earlier entries, files and folders are suggested in a list while the user types.
[_]
Prompt characters and underlined input positions show what is expected, and a label shows a currency symbol or a unit next to the input.
[v]
Required positions and ranges are checked, together with the application's own checks.
Screenshots
The demo sample shows fields for a phone number, a ZIP+4 code, an amount with the popup calculator, a percentage, a quantity, an IP address, a hexadecimal color, a license key, a PIN, a city with autocomplete and a file name with an ellipsis button, with options for the culture, dark mode, high contrast, the input mode, the prompt character and the colors for invalid contents.
.NET Framework and .NET 10
SftMask/NET 3.0 runs in .NET Framework 4.7 (or later) applications and in .NET 10 (or later) Windows Forms applications, with the same classes, properties, methods and events on both. .NET projects reference the Softelvdm.SftMaskNET NuGet package from the package source Setup registers; .NET Framework projects reference the assembly directly. In both, Visual Studio's designer hosts the control: place it from the toolbox, edit it in the Properties window, and set up the mask, the calculator and autocomplete in the property pages.
Built for modern Windows
Version 3.0 follows the system's choices, so your forms do too.
Set one property and the control follows the Windows light/dark setting, calculator and autocomplete list included, switching when the user changes it.
The control, its buttons and its popups are sized for the DPI of the monitor showing them.
Built-in UI Automation support makes the control, its buttons, the calculator and the autocomplete list available to Narrator, NVDA, JAWS and others.
Honors the Windows contrast theme at your option, as Microsoft's accessibility guidelines require.
Development
Platforms
Compatibility
Distribution
Save with the bundle
SftBox/NET 3.0, SftDate/NET 3.0, SftMask/NET 3.0, SftTabs/NET 3.0 and SftTree/NET 3.0 in one hugely discounted bundle.