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;  
        
        }

  

 posted on 2014-07-08 19:05  生活奋斗  阅读(314)  评论(0编辑  收藏  举报