|
-
Apr 21st, 2008, 06:07 PM
#1
Thread Starter
Hyperactive Member
[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
-
Apr 21st, 2008, 06:33 PM
#2
Re: [2005] Highlighting a listbox item
Use the FindString or FinsStringExact method of the ListBox to get the index, then set the SelectedIndex property.
-
Apr 21st, 2008, 06:58 PM
#3
Thread Starter
Hyperactive Member
Re: [2005] Highlighting a listbox item
okay........listbox1.findstring(textbox1.text) and then what do i to select the result of that ?
-
Apr 21st, 2008, 07:18 PM
#4
Re: [2005] Highlighting a listbox item
Read my post again. This time read this bit too:
set the SelectedIndex property
-
Apr 21st, 2008, 07:24 PM
#5
Thread Starter
Hyperactive Member
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
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
|