+92 332 4229 857 99ProjectIdeas@Gmail.com

Searching In ListBox Through LINQ (C#.net)




Searching In ListBox Through LINQ (C#.net):
The following code shows you how to search in listbox items through Langauge Integrated Query (LINQ).

Code

using System.Linq;

var query =
    from object obj in ListBox1.Items
    where (obj.ToString().Equals(TextBox1.Text))
    select obj;

   foreach (object obj in query)
       ListBox1.SelectedItem = obj;

0 comments: