Link to home
Start Free TrialLog in
Avatar of motokent
motokent

asked on

VB COMBOBOX: array with the autocomplete matches?

I am using a combobox with auto-complete enabled.  At runtime, when the text changes I would like to count the number of matches.  If there is only one match, then I'll take some action (without user having to hit "enter", or do anything else).  Is there a collection or array that contains the matches?  It would have the same items that get displayed in the drop-down.
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

To what is your combobox bound ? From where do the items come ?
Are you sure that you want to count each time a character is entered (on_keypress-event) ?
Avatar of motokent
motokent

ASKER

I generate the items in the combobox when the application is started (based on a text file as the data source).

My plan is to check for the number of matches once the (number of characters) > 6.  (Each line has 8 characters.)
Then, if/when there is only one match, I assume that is what the user intends to enter and I process data based on the match.

I can accomplish this by counting the matches in my arraylist that was used to populate the combobox in the beginning, but if I can access the items that autocomplete assigns to the drop-down box, that will save time since autocomplete has already done most of the work for me.
ASKER CERTIFIED SOLUTION
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you.  This is good.