+92 332 4229 857 99ProjectIdeas@Gmail.com

Searching In ListBox Through LINQ (Vb.net)




The following code shows you how to search item in listbox through language integrated query (LINQ).








Imports System.Linq

    Dim query As IEnumerable(Of Object) = _
            From obj As Object In ListBox1.Items _
            Where obj.ToString().Equals(TextBox1.Text) _
            Select obj

    For Each ob As Object In query
         ListBox1.SelectedItem = ob
    Next

0 comments: