HeaderPane
Main
Hide
Share Link
Print

Comparison with MaskedTextBox and NumericUpDown

SftMask/NET covers all functions of the Windows Forms MaskedTextBox and NumericUpDown controls. It is not a drop-in replacement: it uses its own mask syntax (see Edit Masks), and its properties, methods, events and enumerations have their own names and types. These tables show where each function of the Windows Forms controls is found.

MaskedTextBox

MaskedTextBoxSftMask/NET
MaskSftMask.Mask, in the SftMask mask syntax. The MaskedTextBox characters 0, 9, L, ?, &, C, A, a and \ correspond to #, 9, ?, @, &, ~, A, a and \; the case conversions <, > and | to <l, <u and >; the placeholders $, : and / to the culture tokens |, : and /; and the placeholders #, . and , (an optional digit or sign, the decimal separator and the group separator) to numeric fields.
Text, TextLength, TextMaskFormat, CutCopyMaskFormatSftMask.Text, SftMask.TextLength, SftMask.TextFormat, SftMask.ClipboardFormat (TextFormatEnum), SftMask.TextWithLiterals, SftMask.TextNoLiterals, SftMask.GetText
MaskCompleted, MaskFullSftMask.IsComplete, SftMask.IsFull, SftMask.IsEmpty, SftMask.IsValid
MaskedTextProviderSftMask.Positions, SftMask.Values
PromptChar, HidePromptOnLeaveSftMask.PromptChar, SftMask.ShowPromptNoFocus, SftMask.PromptUnderline, SftMask.PromptUnderlineNoFocus
AllowPromptAsInput, AsciiOnly, BeepOnError, RejectInputOnFirstFailure, ResetOnPrompt, ResetOnSpace, SkipLiteralsThe properties of the same names.
InsertKeyMode, IsOverwriteMode, IsOverwriteModeChangedSftMask.InputMode (InputModeEnum), SftMask.Overtype, SftMask.InputModeChanged
PasswordChar, UseSystemPasswordCharThe properties of the same names, and <p blocks in the mask.
ValidatingType, ValidateText, TypeValidationCompletedThe members of the same names, and SftMask.IsValid, SftMask.ValidateContents, SftMask.CustomValidation and SftMask.ValidationError
MaskInputRejected, MaskChangedSftMask.InputRejected (with the reason in InputRejectedEventArgs.Reason), SftMask.MaskChanged
Culture, FormatProviderSftMask.Culture
Undo, ClearUndo, CanUndo, Modified, ModifiedChangedThe members of the same names; Undo keeps up to 16 changes.
Copy, Cut, Paste, Clear, Select, SelectAll, DeselectAll, SelectionStart, SelectionLength, SelectedText, HideSelection, ShortcutsEnabledThe members of the same names, and SftMask.PrePaste
AppendTextSftMask.SelectedText, after SftMask.Select has placed the caret at the end
GetCharFromPosition, GetCharIndexFromPosition, GetPositionFromCharIndexSftMask.GetCharIndexFromPosition with SftMask.Positions for the character, SftMask.GetPositionFromCharIndex, SftMask.GetCharBounds and SftMask.HitTest
MaxLength, ReadOnly, TextAlign, BorderStyleThe properties of the same names.
BorderStyleChanged, HideSelectionChanged, ReadOnlyChanged, TextAlignChangedSftMask.PropertyChanged, with the name of the property

NumericUpDown

NumericUpDownSftMask/NET
Value, ValueChangedSftMask.Value (a nullable decimal, the first numeric field), SftMask.ValueChanged, SftMask.Values for further fields
Minimum, MaximumThe range of the numeric field in the mask, such as $^-,6.2(-5000,5000)
DecimalPlaces, ThousandsSeparator, HexadecimalThe fraction digits, the , subtoken and $X fields of the mask
Increment, AccelerationsSftMask.SpinIncrement, SftMask.SpinAccelerations
UpButton, DownButtonSftMask.SpinUp, SftMask.SpinDown, SftMask.UpDownPress
UpDownAlign, InterceptArrowKeysSftMask.UpDownAlign, SftMask.SpinArrowKeys, and SftMask.ButtonStyle to show the buttons
ReadOnly, TextAlignThe properties of the same names (a read-only SftMask control also disables its buttons and spinning), and SftMask.ReadOnlyUpDown to disable only the buttons
BeginInit, EndInitSftMask.Initializing; the control also implements ISupportInitialize

A numeric field spun past an end of its range wraps around to the other end; the N subtoken makes it stop at the ends as the NumericUpDown control does.

Beyond Both Controls