.net2.0提供的TextBox候选文字提示功能
哈哈,首先要设置TextBox的AutoCompleteMode为Suggest
AutoCompleteSource为CustomSource。
然后就写代码了:)
不多说了。
郁闷,我的博客出了BUG。
AutoCompleteSource为CustomSource。
然后就写代码了:)
private void Form1_Load(object sender, EventArgs e)
{
AutoCompleteStringCollection collection = new AutoCompleteStringCollection();
textBox2.AutoCompleteCustomSource = collection;
collection.AddRange(new string[] { "a", "aaa", "aaaa", "aaaaa", "aaaaaa", "aaaaaaaaccc" });
}
嗷嗷简单吧。{
AutoCompleteStringCollection collection = new AutoCompleteStringCollection();
textBox2.AutoCompleteCustomSource = collection;
collection.AddRange(new string[] { "a", "aaa", "aaaa", "aaaaa", "aaaaaa", "aaaaaaaaccc" });
}
不多说了。
郁闷,我的博客出了BUG。