Link to home
Start Free TrialLog in
Avatar of kplonk
kplonk

asked on

Two in one i guss

I have a list box and a text box, i would like to set the list box and the text box up to function in a similer manner to the combobox. So if for example the list box was a list of words sorted and i started to type the work play into the text box i want to scrol the list box to the p section and the the pl section and so on. Any ides on how to do this. The second part of the question is to do with the first list box, i would like to set the tool tip text to the same as what the mouse is over at the time. Any help will be great, i have vb6 if that helps.
Avatar of vettranger
vettranger

Go to the following site and get to the draglist control. It has a quick search method that does what you want with the first part of your question. This will be much better than the alternative, which would be to loop thru your list matching the contents of the textbox to items in your list using the length of the textbox text.

http://www.mvps.org/ccrp/
ASKER CERTIFIED SOLUTION
Avatar of vettranger
vettranger

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
Avatar of kplonk

ASKER

thanks this worked great
Happy to help! :-) It just struck me on the 2nd part. After you computer item, compare it to the listcount property of the list box (and probably listcount-1) before setting the tooltip. Altho I didn't try that, it might be possible to get a number greater than a valid index into the Contents collection if the listbox is only partially filled and the mouse moves into the empty area below the list.
Avatar of kplonk

ASKER

yes you can but this is no proble as i have sorted it with a simple error handler, all is well thanks a lot see you later.
Well done :-)
Avatar of kplonk

ASKER

Hello vettranger, i have a question for you i will give you some points if you are able to help. I would like to make the list control tht you sujested to me do a few more things, for example if i was on item 10 of 40 in the list and all 40 were displayed, when i press the page down key i would like to make the box scrol so that item 10 was now on the top of the list box. I would like to make the sam thing happen for the page up key. any ideas