private void textBox1_TextChanged(object sender, EventArgs e)
{
TextBox t = sender as TextBox;
if (t != null)
{
// say you want to do a search when user types 3 or more chars
if (t.Text.Length >= 1)
{
AutoCompleteStringCollection Collection = new AutoCompleteStringCollection();
Collection.AddRange((from x in MapNames where x.StartsWith(t.Text) select x).ToArray());
this.MapNameBox.AutoCompleteCustomSource = Collection;
}
}
}