How to search ListBox using the same criteria as like "%%" in sql for example if the list contains the following items {cat , dog , cat with ring,dog with bone} and entered "with" in the textbox. i need to filter this listbox to only have records containig the word "with" ( i.e {cat with ring,dog with bone}).
so far i can search and select the item starting with the input string using this code ..
private void txtSearch_TextChanged(object sender, EventArgs e)
{
int index = lst.FindString(this.txtSearch.Text);
if (0 <= index)
{
lst.SelectedIndex = index;
}
}
string.Contains
to filter it? – Michael Edenfield