![]() |
Visit HouseLocator.com for Homes for sale in the USA. | |
|
|
|
|
|
Frequently Asked Questions: Don't find answer to your question? post a Support Request on the User Forum
How do I use AutoCompleteTextBox in my Project. The AutoCompleteTextBox(AC) has all the standard Properties, Methods and Events of a TextBox Control. In the simplest case, you can drop it on a Form and use it like a Standard TextBox. Make sure the SaveonReturn Property is set to True, that will cause the Control to save the current entry whenever the user hits Enter. Alternatively, if you want the current Text of the TextBox is to be saved when the user hits a Command Button. Call the AddCurrentItem Method in the Click event of the Button to Save the current Entry in the List. If you want to Save the current entry whenever the control looses Focus, you may call the AddCurrentItem Method in the Validate Event of the Control. The Control builds a list of Entries automatically, or by hardcoding. As the user types in, it looks for matches with any of the saved Entries, the comparison is NOT Case sensitive. If a match is found, the Entry is shown in a Drop Down List, and the user can select the Entry From the List to Complete the word. The number of entries to be saved in the List can be customized. Default for this is 100. When a new entry is made and the List is full, the oldest Entry will be deleted. So the List effectively works as a First in First Out (FIFO) buffer.
How does the Automatic Save/Retrieve of the List Work? Each instance of the Control has a unique location in the registry to save its List and Retrieve it whenever the Control is loaded. This is a completely automatic process and the developer or user doesn't have to do anything to Enable this feature. However, occasionally, it may be required to Save/Retrieve the List into a Database or Disk File, in that case, the Automatic Save/Retrieveal feature could be disabled by setting AutoSaveList Property to False.
How to Implement Custom Save/Retrieval of the List, say, if I wanted to save the list in a Database instead of the Registry? Disable the Auto Save Feature by setting AutoSaveList Property to False. In the Form's Unload Event, Read the StringValue Property of the AutoCompleteTextBox and save it anywhere you can save a string value. The StringValue Property is a single String containing all the List Entries seperated by carriage return. In the Load Event of the Form, retrieve the StringValue from the saved location and set it to the StringValue Property of the Control.
How to make multiple AutoComplete Controls share the same list? Make sure you have the latest release of AC, because the initial release didn't have this option. Read the Seed Property of the AutoComplete Control, whose List you want to share with other AutoComplete Controls, then assign this string to the Seed properties of the other AutoComplete Controls. This should go in the Load Event of the Form. Make sure that except the First Control, all other's AutoSaveList Property is set to False.
When the Text in the TextBox is saved in the List? Whenever the AddCurrentItem Method is called, and if the SaveOnReturn Property is set to True, whenever the user hits Enter. You may also add any String to the List by calling the AddItem Method of the Control. You may also load the control with a List built from an Array of strings by using the ListFromArray Method, or a List from a Collection by using the ListFromCollection Method.
Whenever the Form is unloaded, the Lists of all AutoComplete Controls on the Form are saved in the registry.
Can I use AutoCompleteTextBox in my own ActiveX Control as a Constituent Control? Yes, but you must call the ReSeed Method of the Control in the Init_Properties Event of your UserControl. This will make sure two instances of your ActiveX Control will not share the same List. Otherwise there is a strong chance of conflict. The ReSeed Method is added in the Latest Release.
What Development tools will it work in? The AutoCompleteTextBox is created and tested with VB6 Service pack 5. If you have difficulty in using it in any other development environment, please let us know.
Does it have any dependencies? No, it does not have any dependencies other than the standard VB Runtimes.
Why is the source not available? To make sure there is no issue with the Binary Compatibility. Moreoever, the code is not meant to be for educational purpose and not well documented. If you want any Feature to be implemented, let us know, as the developers of of the Control, it will be easier for us to incorporate the New Features.
|
|
|||||||||||||||||||
|
Let us save your time |
Copyright 2002 Alpha Net Consults, LLC |