110,561
社区成员
发帖
与我相关
我的任务
分享
AutoCompleteStringCollection acsc = new AutoCompleteStringCollection();
acsc.Add("asdjhkj");
acsc.Add("2412312");
acsc.Add("asdaasdkj");
acsc.Add("78fsdfhj");
acsc.Add("0if0sdfn");
acsc.Add("67dasgdh");
acsc.Add("0dasdjasd");
acsc.Add("23ashdb");
this.textBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
this.textBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
this.textBox1.AutoCompleteCustomSource = acsc;
winfrom textbox输入智能提示
核心代码:
//下面3行用设置智能提示
this.textBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
this.textBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
this.textBox1.AutoCompleteCustomSource = ac;//设置数据源
其中 AutoCompleteStringCollection ac = new AutoCompleteStringCollection();
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/LCL_data/archive/2009/12/18/5032160.aspx