I have a multiselect Listbox on a Form. I need to iterate through this listbox and do something with all of the items that have been selected. Nothing I've tried has worked. Here is my lastest attempt.So, how do I go through the entire listbox and do my thing what all of the items that have been selected?vb.net Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim item As Object For i As Integer = ListBox1.Items.Count - 1 To 0 Step -1 If ListBox1.SelectedItems(i) = True Then 'do something with them End If Next End Sub




Reply With Quote