If you are looking to set the initial selection, you should try using
SelectedIndex
.
SelectedItem
is an object type property it would return the actual object that is bound to the control.
Assuming it is a windows form, following works fine for me:
listBox1.Items.AddRange(new string[] { "1", "2", "3" });
listBox1.SelectedIndex = 0;
string str = listBox1.SelectedItem.ToString();
You can uncomment SelectedItem line and comment SelectedIndex line and that would work fine too.