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; }
让自己的Textbox能自动完成及字词联想
工作生活中,需要写个程序的时候就编个;
编写的过程中,需要用到的不会的就去网上搜个;
任务完成就好,不求闻达。