When I use Shift+Click to select multiple items in a listbox, the following code is not recognizing the selected items between the first selected index and the last selected index as being selected:
Here is the output of the message box when it gets to index 4 in the listbox.
The .GetSelected(index) As Integer returns true if the specified item is selected, so I believe I'm using the correct function.
Could someone tell me what I'm doing wrong or if there is a better way to determine if the specified index is selected or not?
Thanks
VB.NET:
For i As Integer = 0 To listSongs.Items.Count - 1 Step 1
MessageBox.Show("Index of " & i & " is selected: " & listSongs.GetSelected(i))
If listSongs.GetSelected(i) Then
Dim item As New listbox_items
item.index = i
selected_arr.Add(item)
End If
Next
Here is the output of the message box when it gets to index 4 in the listbox.
The .GetSelected(index) As Integer returns true if the specified item is selected, so I believe I'm using the correct function.
Could someone tell me what I'm doing wrong or if there is a better way to determine if the specified index is selected or not?
Thanks