Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

Autocomplete

SftMask/OCX supports three autocomplete methods, which are intended to assist the user in entering data, by recalling previously entered data or by displaying a list of files/directories.

The AutoComplete.Contents property is used to define whether text or files/directories are shown.

The Mode property is used to define the desired autocomplete display method (suggest, append or suggest+append).

Generally, autocomplete can be used with input fields where similar data is entered repeatedly or varying, but possibly repeating input data is entered. It should not be used in situations where a fixed set of entries are used. In such cases, a combo box may be a better solution.

The autocomplete feature is supported for both masked input and when using the control as a simple edit control. Depending on the Mask property used, autocomplete may be disabled.

Between 1 and 1000 entries can be saved as defined using the AutoComplete.MaxEntries property. The file defined using the AutoComplete.File property is used to save the data permanently. As entries are saved, if the maximum number of entries has been reached, the least recently saved or used entry is discarded to make room for the new entry. When displaying files or directory names, the file defined using the AutoComplete.File property is optional and is only used to save the autocomplete window size.

The autocomplete window size can be further controlled using the AutoComplete.OptimalHeight and AutoComplete.MaxShown properties.

It is possible to switch between autocomplete modes by setting the AutoComplete.Mode property, while using the same saved entries in the file defined by the AutoComplete.File property. When changing the Mask property, saved entries may become unusable and the file must be deleted instead.

The Rollup method can be used to close the popup calendar, popup calculator and autocomplete window.

Suggestion

This mode displays a drop down list of matching items as the user enters data. This mode is selected by setting the AutoComplete.Mode property to autocompleteSftMaskSuggest.

With each keystroke the list is refreshed and may increase or decrease. If no entries are present, the drop down list is no longer displayed.

In this example the user types the characters "A f-u-n-n-y" resulting in the following display:

The drop down list is displayed as long as there are matching saved entries or if custom entries are present (see AutoComplete.ShowOne property). Custom entries can be added using the AutoComplete.AddTop an AutoComplete.AddBottom methods while handling the MatchAddCustomItems event.

The drop down list can be resized by the user by dragging the resizing box in the bottom right corner of the list. The drop down dimensions are saved along with the autocomplete entries in the file defined by the AutoComplete.File property.

While the drop down list is created or each time it is refreshed, the application receives the Matching and MatchAddCustomItems events. If the user selects and accepts a saved entry, the MatchAccept or MatchCustom event occurs.

New input data is saved when the edit control loses the input focus.

Append

This mode adds a possible completion of the current input as a selection. The user can either accept the input or simply continue entering data without interruption.

This mode is selected by setting the AutoComplete.Mode property to autocompleteSftMaskAppend.

With each keystroke the possible completion is reevaluated and refreshed.

In this example the user types the characters "A f-u-n-n-y" resulting in the following display:

While the possible completion is evaluated or refreshed, the application receives the Matching event.

The autocomplete entries are saved in the file defined by the AutoComplete.File property.

New input data is saved when the edit control loses the input focus.

Suggestion + Append

This mode displays a drop down list of matching saved items as the user enters data and adds a possible completion of the current input as a selection.

This mode is selected by setting the AutoComplete.Mode property to autocompleteSftMaskSuggestAppend.

With each keystroke the list is refreshed and the possible completion is reevaluated and refreshed. If no entries are present, the drop down list is no longer displayed.

In this example the user types the characters "A f-u-n-n-y" resulting in the following display:

The drop down list is displayed as long as there are matching saved entries (see AutoComplete.ShowOne property).

The drop down list can be resized by the user by dragging the resizing box in the bottom right corner of the list. The drop down dimensions are saved along with the autocomplete entries in the file defined by the AutoComplete.File property.

While the drop down list is created or each time it is refreshed, the application receives the Matching event. If the user selects and accepts a saved entry, the MatchAccept event occurs.

New input data is saved when the edit control loses the input focus.


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.