Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting an item in a listbox

Status
Not open for further replies.

amberlynn

Programmer
Dec 18, 2003
502
CA
Hello,

How can I set my listbox to equal a certain value (string).
I know that the listbox does contain this string.

I'm trying it this way:

Me.listbox.SelectedValue = myString

I've also tried SelectedItem, but neither work.
I don't get an error message, but my topmost item always remains selected.

Thanks!
Amber
 
use

listbox.seleteditemindex = listbox.items.indexof(myString)

or something like that.

-Rick

----------------------

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top