How To Simulate an Incremental Search from a Text Box (166378)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q166378 SUMMARY
The combo box control has an Incremental Search property that, when set to
true (.T.), searches the Control Source of the combo box with each
keystroke. Thus, if a user types the string "ABC," the table is searched
after each keystroke, first for the letter "A," then the string "AB," then
the string "ABC."
While this is a very useful property, the fact that the search is triggered
by action rather than inaction causes UI problems--the user may not want to
search for each letter of a string as he or she builds it, but rather
search for the whole string after it has been fully entered. The text box
does not have an incremental search property, but the action can be
simulated, and made to search when the user stops typing, rather than when
the user is entering the string for which to search.
The code in this article creates a fully editable text box that implements
an incremental search procedure. Using a timer, the incremental search is
triggered when the user has not pressed a key for a certain timeout period.
Modification Type: | Minor | Last Reviewed: | 7/13/2004 |
---|
Keywords: | kbDesigner kbhowto kbOOP KB166378 |
---|
|