Partager via


AutoComplete Property

Specifies that the text box tracks values previously entered and makes them available in a dynamic list of suggested entries. Read/write at design time and run time.

Textbox.AutoComplete [ = nValue]

Return Value

  • nValue
    Integer data type. The following table lists the values for nValue.

    nValue Setting

    0

    Does not display a list of entries.

    1

    Alphabetical   Sorts entries alphabetically and is not case sensitive.

    2

    Most Frequently Used (MFU)   Sorts entries based on the highest count.

    3

    Most Recently Used   Sorts entries based on the Updated field in the source table with the most recent first.

    4

    Custom   Uses the Weight field populated using your own algorithm to specify how you want the entries sorted. The results are sorted in descending order (highest to lowest value). If there are ties, then the Updated field is used (most recent appears first).

Remarks

Applies to: TextBox Control (Visual FoxPro)

Set the AutoComplete property to provide a text box that automatically stores and suggests values. As characters are typed, a drop-down list displays recently entered words that match the pattern of the typed characters. When the user selects an entry from the list, the text box value becomes equal to that entry and updates the usage information for that entry in the Autocomp.dbf or other table you have specified.

For more information about how the data is stored, see AutoCompTable Property.

If you use the custom sort option (4), you need to define the weighted order by updating the Weight field in the AutoComplete table, which is reserved for your use. For example, you might specify code in the Valid Event for the text box which updates the Weight field based on frequency timing in which more recent entries are given a higher weight value.

If you want to control the number of items that appear in the dynamic list, you can set the List Display Count option in the Options dialog box. You can also specify this setting with SYS(2910) - List Display Count.

See Also

Reference

TextBox Control (Visual FoxPro)
AutoCompTable Property
AutoCompSource Property

Other Resources

Properties (Visual FoxPro)