winform能不能实现 像百度那样的文本框输入 我每输入一个字都可以从数据库中将类似的字符串查询出来,并像百度的那样下拉显示出来实现过的朋友指点一下 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 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 可以的,在Text.Text changed事件里执行查询 this.textBox1.AutoCompleteCustomSource.AddRange(new string[] { "aaaaaaa", "aabbbbb", "cccccc", "dddddd"}); this.textBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; this.textBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource; 还在吗?我想问一下照你说的去做了后又这个错误是怎么回事错误 1 无法将类型“System.Windows.Forms.AutoCompleteStringCollection”隐式转换为“System.Windows.Forms.AutoCompleteSource” D:\c#Projects\BeforeHandBuy\BeforeHandBuy\BuyMainForm.cs 26 51 BeforeHandBuy 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; 还是有问题啊 我在textbox的textchanged事件中将返回的dt添加到AutoCompleteStringCollection 对象中AutoCompleteStringCollection = ac = new AutoCompleteStringCollection();for(int i = 0 ;i< dt.rows.count;i++){ ac.add(dt.rows[i][0].tostring());}其他完全一样!这样还是出错阿! C#下这种效果的注释应该怎么实现 Winform中GID+绘图问题。。 新人来也 起步问题请教 c# 打印 c# 自定义控件如何在属性栏添加自定义事件?可以双击生成+=代码? 有没有办法让 OnClientClick 中的函数在验证控件的代码后执行? 怎样序列化一个类对象到数据库中,没想法,请高手提点! ADODB.Connection的Execute方法怎么用啊? 还是请教下 服务器端设计的问题 表布一个比Lostinet的ComboBox控件起码简单十倍,但功能强大的combobox控件,原创的。 使用SVN导入的程序不能正常编译,求教 用VS2005自带的安装和部署打包问题
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
"aaaaaaa",
"aabbbbb",
"cccccc",
"dddddd"});
this.textBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
this.textBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
我想问一下
照你说的去做了后又这个错误是怎么回事错误 1 无法将类型“System.Windows.Forms.AutoCompleteStringCollection”隐式转换为“System.Windows.Forms.AutoCompleteSource” D:\c#Projects\BeforeHandBuy\BeforeHandBuy\BuyMainForm.cs 26 51 BeforeHandBuy
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;
我在textbox的textchanged事件中将返回的dt添加到AutoCompleteStringCollection 对象中AutoCompleteStringCollection = ac = new AutoCompleteStringCollection();
for(int i = 0 ;i< dt.rows.count;i++)
{
ac.add(dt.rows[i][0].tostring());
}
其他完全一样!
这样还是出错阿!