Setting a combobox value

  • Thread starter Thread starter AussieRules
  • Start date Start date
A

AussieRules

This is a stupid ? I know, but I am brain blocked

I have a combobox, with four items in it.

I have a value in a string, which will match one of the four items.

How do I set the combobox text to be my value

Thanks
 
* "AussieRules said:
I have a combobox, with four items in it.

I have a value in a string, which will match one of the four items.

How do I set the combobox text to be my value

\\\
Me.ListBox1.SelectedIndex = Me.ListBox1.FindStringExact("Bla")
///
 
Hi Aussie,

When you see this, and think what is this,

I thought that Hefried did declare his comboboxes always like this

private listbox1 as new combobox.

:-))

Cor
 
AussieRules said:
This is a stupid ? I know, but I am brain blocked

I have a combobox, with four items in it.

I have a value in a string, which will match one of the four items.

How do I set the combobox text to be my value

Thanks

I'm taking a guess ato exaclt what you want. But I think you need to
loop through the items comparing the Text property of each item to the
string variable. When you get a hit, you will know the Index of the
item and you can use the SelectedIndex property to set it.
 
Back
Top