views:

419

answers:

1

Hi how to display seleted item values in multi selected listbox using winforms.

can somebody give me a sample code snippet?

thanks in advance

+3  A: 

Does ListBox.SelectedItems not do what you want?

for (object x in listBox.SelectedItems)
{
    // Do something with the selected item
}

You can also use ListBox.SelectedIndices.

Jon Skeet
i want to display one by one value in listbox (selected values only)
Nagu
@Nagu: And what problem are you running into?
Jon Skeet
i want to display the value of list box selected value
Nagu
@Nagu: Right, so I've given an example which gives you the selected value... what problem are you having?
Jon Skeet