|
-
Feb 9th, 2003, 03:48 AM
#1
Thread Starter
Member
vanishing ListIndex
Hi,
I've created an ActiveX combo control that behaves like an Access combo - when typing text into it it finds the closest matching entry from the list and highlights the auto-completed text so that the user can continue typing.
When I assign it a string through code it works like a dream (at the end of the process I'm left with the right ListIndex).
The problem is that after I type a char into it, it finds the right entry (and assign the right ListIndex to the ActiveX internal combobox), but once its out of the code module that doe's the search it loses the ListIndex and it defaults to -1!
I've gone through the code few times and don't understand how come when assigning strings by code all is good but when typing it doesn't work even though the same code is called (from the ActiveX's combobox_Change event).
Help would be appreciated.
Thanx
-
Feb 19th, 2003, 05:55 PM
#2
Fanatic Member
Well ComboBoxes ListIndex(s) are -1 when nothing is selected, is it possible that when you are matching items in your combo box that you never actually select the item it is matching too?. So if in code it is finding it in code, try being redundant and setting it explicitly...
VB Code:
Dim ind as Integer
'Code locates right index ( I am assuming from what you said)
ind=Combo1.ListIndex
'At end of all code processing
Combo1.ListIndex=ind
Either way it is not actually selecting the item your matching in code is the bottom line. Or if you are finding the match by string comparison and getting the matches ListIndex then you need to do an explicit assignment.
-
Feb 20th, 2003, 12:29 AM
#3
Thread Starter
Member
thats not the case I'm afraid. The list item is found using an API call and the List Index is set accordingly.
Thanx though
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|