让自己的Textbox能自动完成及字词联想
private void MaintainForm_Load(object sender, EventArgs e) { string[] array = new string[] { "hello", "hi", "nihao", "hehe", "yes", "no", "nobody", "morning", "yellow", "moon" }; AutoCompleteStringCollection AutoCollection = new AutoCompleteStringCollection(); AutoCollection.AddRange(array); textBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend; textBox1.AutoCompleteSource = AutoCompleteSource.CustomSource; textBox1.AutoCompleteCustomSource = AutoCollection; }
本文来自博客园,作者:情怀丶感伤,转载请注明原文链接:https://www.cnblogs.com/sures/p/9954610.html