how to get multiselect selectedvalue from listbox in vb.net window application?

  • Thread starter Thread starter Tony Dong
  • Start date Start date
T

Tony Dong

Hi there

I have one multiselect listbox, and get date from database using DataSet

HolidaysListBox.ValueMember = "HolidayDate"
HolidaysListBox.DisplayMember = "HolidayName"
HolidaysListBox.DataSource =
HolidayDS.Tables("dtHolidays").DefaultView

if I use one selected, it is working fine and I can get result using
HolidaysListBox.SelectedValue

But I don't know how to get the multiselected ValueMember results from this
listbox, anyone can help me?

Thanks
 
Hi Tony,

Here's some code that should help:

Dim i As Integer

For i = 0 To selectbox.SelectedItems.Count - 1

messagebox.show(selectbox.selecteditems(i))

Next

HTH,

Bernie Yaeger
 
Back
Top