ListBox.Items(0).Value = "Foo"
ListBox.Items(1).Value = "Foo1"
The number (0) is the ordinal reference of the list box item, zero based,
starting from the top.
Your code was actually setting the selected value, as would happen if the
user clicked the item on the list.
Hope that helps!
Simon.
"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:4F**********************************@microsof t.com...
Hi I have a listbox and have the selection mode set to multiple in the
property box.
I am trying to set multiple selected values in code but it only seems to
use
the last one.
listbox.SelectedValue = 1
listbox.SelectedValue = 2
thanks.
only 2 gets set above.
--
Paul G
Software engineer.