C# TextBox自动完成

            //定义一个List
List<string> list = new List<string>();
//添加数组
list.AddRange(new string[] { "11", "12", "13", "22", "23", "24" });
//设置文本框自动完成源
textBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;
//设置文本框自动完成模式
textBox1.AutoCompleteMode = AutoCompleteMode.Suggest;
//循环添加自动完成源的数据
foreach (string s in list)
textBox1.AutoCompleteCustomSource.Add(s);
原文地址:https://www.cnblogs.com/ghypnus/p/2414058.html