[2005] Highlighting a listbox item
Hi to all,
i have a listbox that have a lot of items and i would like to give the user the
ability of searching through those items by just inserting the items name in a textbox and then press a button, and the item that the user inserted on the textbox will be highlight on the listbox, of course if it exist......
i know how to do this with a textbox but i dont know how to do it with a listbox
thanks:)
Re: [2005] Highlighting a listbox item
Use the FindString or FinsStringExact method of the ListBox to get the index, then set the SelectedIndex property.
Re: [2005] Highlighting a listbox item
okay........listbox1.findstring(textbox1.text) and then what do i to select the result of that ?
Re: [2005] Highlighting a listbox item
Read my post again. This time read this bit too:
Quote:
set the SelectedIndex property
Re: [2005] Highlighting a listbox item
Sorry jmcilhinney, i was trying to make this work with a project i had there must be something wrong, but i wrote the code correctly the first time and i did read your post, i tried it on a new project and it works perfect ! thanks