private void Form1_Load(object sender, EventArgs e)
{
//自动完成字符串的集合
AutoCompleteStringCollection strings = new AutoCompleteStringCollection();
strings.Add("A1");//不区分大小写
strings.Add("A2");
strings.Add("Aas");
strings.Add("B1");
strings.Add("Beijing");
strings.Add("bb-cims");
textBox1.AutoCompleteCustomSource = strings;
textBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;
textBox1.AutoCompleteMode = AutoCompleteMode.Suggest;
}
这样你在textBox1中输入A或者a时就会在下拉框中显示出A1...A2...Aas