V
VBShaper
Guest
I would like to Loop through a listbox's items and select items from 0 to the input from a textbox, so if the textbox text was 10 the first 10 items in the listbox would be selected.
The following loops through the Listbox and selects every item.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
For i As Integer = 0 To ListBox1.Items.Count - 1
ListBox1.SetSelected(i, True)
Next
ListBox1.SelectionMode = SelectionMode.MultiExtended
End Sub
Continue reading...
The following loops through the Listbox and selects every item.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
For i As Integer = 0 To ListBox1.Items.Count - 1
ListBox1.SetSelected(i, True)
Next
ListBox1.SelectionMode = SelectionMode.MultiExtended
End Sub
Continue reading...