Hi, I have a issues, I have to load again the listbox, after filtering trought a textbox if a string is the same. I tried this code, but doesn't work at the is null or empthy, how can I reload it by a cicle for?
Private Sub TextBox3_TextChanged(sender As Object, e As EventArgs) Handles TextBox3.TextChanged
Dim items = From it In ListBox1.Items.Cast(Of Object)()
Where it.ToString().IndexOf(TextBox3.Text, StringComparison.CurrentCultureIgnoreCase) >= 0
Dim matchingItemList As List(Of Object) = items.ToList()
ListBox1.BeginUpdate()
ListBox1.Items.Clear()
For Each item In matchingItemList
ListBox1.Items.Add(item)
Next
If String.IsNullOrEmpty(TextBox3.Text) Then
ListBox1.Items.AddRange(My.Settings.userlist.ToString)
End If
ListBox1.EndUpdate()
End Sub