C# 仿百度自动匹配

private void Form1_Load(object sender, EventArgs e)
        {
            AutoCompleteStringCollection source = new AutoCompleteStringCollection();  
            source.AddRange(new string[]  
                    {  
                        "January",  
                        "February",  
                        "March",  
                        "April",  
                        "May",  
                        "June",  
                        "July",  
                        "August",  
                        "September",  
                        "October",  
                        "November",  
                        "December"  
                    });  
  
            TextBox textBox = new TextBox();  
  
  
  
  
            textBox.AutoCompleteCustomSource = source;  
            textBox.AutoCompleteMode =  
                AutoCompleteMode.SuggestAppend;  
            textBox.AutoCompleteSource =  
                AutoCompleteSource.CustomSource;  
            textBox.Location = new Point(20, 20);  
            textBox.Width = ClientRectangle.Width - 40;  
            textBox.Visible = true;  
  
  
  
            Controls.Add(textBox);  
            //comboBox1.DropDownHeight = 300;  
        
        }

  C# 仿百度自动匹配_第1张图片

你可能感兴趣的:(C#)