Posted by webmaster Guido
In Reply to how to reset Orpheus CombListBox posted by Jan Dunn
I'm using a TurboPower CombolistBox with autosearch set to true. If you make a selection such as "chief" it finds "chief of police". If I retype "chief" looking for "chief of staff" it keeps defaulting to "chief of police". How can I reset the component so that it forgets the last returned item from the list?
Personally I don't use the Orpheus components suite, but from what I read about it I understand the autosearch feature of the combo listbox is an incremental search. If you type a string, it searches the first item in alphabetical order that starts with that string.
In your example, typing
chief always finds
chief of police because that
is the first item that starts with
chief. The item
chief of staff is only
found when you type at minimum
chief of s. So, "resetting" the component (if this were
possible) would not change this behaviour.
For the behaviour that you want, your component should understand something like "FindNext" after the first search, but I don't know of any listbox that does this. Solution:
- either add this method (command) to the component's source code, not so obvious I assume...;
- or code around it in your application, for example using a button labeled "Find Next" that searches the listbox next items one by one.
I think I've got some similar code lying around using a standard Delphi combo listbox, I'll let you know if I find something.
Guido, DelphiLand Team