Skip to main content

Automatic Completion

  • 2 minutes to read

 

The automatic completion feature can be enabled for the RegEx mask type. In this mode, the editor will try to complete a value that has been partially entered by an end-user. Use the TextEdit.MaskAutoComplete property to specify the required auto-complete mode.

Auto-complete mode

Description

Strong

Each time an end-user types a character, the editor determines if the following placeholder can be filled automatically. If only a specific character can be inserted in this position, the editor automatically displays this character and moves the caret to the right of this character.

Assume that the edit mask is set to "\R{MonthNames}" (the editor will accept month names). When the "M" character is typed by an end-user in the empty edit box the second placeholder is filled automatically with the "a" character, since there are two months starting with "M" (March and May) and both contain an "a" in the second position.

MaskAutoComplete_Strong

If the "r" character is pressed then the editor automatically completes the input and displays "March":

MaskAutoComplete_Strong_2

Optimistic

When an end-user enters a character in the empty edit box for the first time, the editor automatically fills all the following placeholders with the default values. For placeholders that accept only numeric values, the '0' character is the default. For placeholders that accept word characters, the "a" character is the default.

Assume that the mask is set to "\R{MonthNames}". After the "M" character is entered, the editor inserts "May" automatically (this is the shortest variant between the two alternatives - March and May):

MaskAutoComplete_Optimistic

For instance, the edit mask is set to "\d{3}-\d{2}-\d{2}" (a telephone number pattern). When the first character is entered (for instance "1") in the empty edit box, the subsequent placeholders are automatically filled with default values (the "0" characters) and selected.

MaskAutoComplete_Optimistic_2

If the TextEdit.MaskAutoComplete property is set to AutoCompleteType.Default, the editor will use the AutoCompleteType.Strong auto-complete mode.