If you are using VS 2008, you can use Lambda expressions to do this.
private void textBox1_TextChanged(object sender, EventArgs e)
{
// Filter the ListBox to those values that container the entered text
List<string> myList = new List<string> { "First item in list", "Second item in list", "Third item in list" };
var filteredList = myList.Where(s => s.Contains(textBox1.Text));
listBox1.DataSource = filteredList.ToList();
}
This is a case sensitive compare. You can use .ToLower or .ToUpper if you want a case insensitive compare.
Hope this helps.
www.insteptech.com