In insert mode, a typed character is inserted at the caret and the characters after it move to the following input positions that accept them; a shift break (= token, see Edit Masks) stops them. A character is rejected when the characters after it cannot move. In overtype mode, a typed character replaces the character at the caret, which is shown selected.
The SftMask.InputMode property defines the mode and what the Insert key does:
| Value | Description |
|---|---|
| InputModeEnum.InsertOnly | Characters are always inserted; the Insert key has no effect. |
| InputModeEnum.Insert | Characters are inserted; the Insert key switches between insert and overtype mode. This is the default. |
| InputModeEnum.Overtype | Characters replace the existing characters; the Insert key switches between insert and overtype mode. |
| InputModeEnum.InsertOnEntry | Insert mode is used each time the control receives the input focus; the Insert key switches modes. |
| InputModeEnum.OvertypeOnEntry | Overtype mode is used each time the control receives the input focus; the Insert key switches modes. |
| InputModeEnum.Shared | All controls using this mode share one insert/overtype setting, which the Insert key switches. |
The SftMask.Overtype property returns and sets the current mode, and the SftMask.InputModeChanged event occurs when it switches and when the control receives the input focus.
A character that does not fit the mask is rejected and raises the SftMask.InputRejected event, whose arguments tell the position, the character ('\0' for a deletion) and the reason (InputRejectedReasonEnum: typing, deleting, pasting or dropping, or a text set by the application). When the user typed, pasted or deleted, the control also beeps (SftMask.BeepOnError property). A deletion is rejected when it would move characters to positions that do not accept them.
| Property | Description |
|---|---|
| SftMask.SkipLiterals | Typing the literal character at a literal position moves past it, and typing a literal the caret has just moved past, or a group separator of a numeric field, is accepted without a change, so a phone number can be typed with or without its parentheses and dashes. This is the default; otherwise these characters are rejected. |
| SftMask.AsciiOnly | The input positions of the mask accept only ASCII characters. Without a mask, any character is accepted. |
| SftMask.RejectInputOnFirstFailure | A pasted text is rejected as a whole when one of its characters does not fit; otherwise the characters that fit are pasted. |
| SftMask.BeepOnError | The control beeps when it rejects a character or a key. This is the default. |
The SftMask.ReadOnly property makes the contents read-only for the user: the contents can still be selected, copied and dragged as a copy, but typed characters and deletions are rejected with a beep (without the SftMask.InputRejected event), and the up and down buttons, the ellipse button, the calculator and autocomplete are not available. Unless the SftMask.BackColor property is set, a read-only control has the system's control color as its background. The application can still change the contents.
The SftMask.ReadOnlyUpDown property disables only the up and down buttons and the spinning with the Up and Down keys, the SftMask.ReadOnlyEllipse property only the ellipse button.