在winform中向textbox输入内容时下面有提示信息,效果如图所示:
private void Form1_Load( object sender, EventArgs e) |
{ |
AutoCompleteStringCollection strings = new AutoCompleteStringCollection(); |
strings.Add( "A1" ); //不区分大小写 |
strings.Add( "A2" ); |
strings.Add( "Aas" ); |
strings.Add( "B1" ); |
strings.Add( "Beijing" ); |
strings.Add( "bb-cims" ); |
textBox1.AutoCompleteCustomSource = strings; |
textBox1.AutoCompleteSource = AutoCompleteSource.CustomSource; |
textBox1.AutoCompleteMode = AutoCompleteMode.Suggest; |
} |