码迷,mamicode.com
首页 > 其他好文 > 详细

C# 仿百度自动匹配

时间:2014-07-09 15:58:13      阅读:213      评论:0      收藏:0      [点我收藏+]

标签:strong   width   art   cti   for   io   

 
  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.ComponentModel;  
  4. using System.Data;  
  5. using System.Drawing;  
  6. using System.Text;  
  7. using System.Windows.Forms;  
  8.   
  9.   
  10. namespace WindowsApplication1  
  11. {  
  12.     public partial class Form1 : Form  
  13.     {  
  14.         public Form1()  
  15.         {  
  16.             InitializeComponent();  
  17.         }  
  18.   
  19.   
  20.         private void comboBox1_TextChanged(object sender, EventArgs e)  
  21.         {  
  22.              
  23.         }  
  24.   
  25.   
  26.         private void Form1_Load(object sender, EventArgs e)  
  27.         {  
  28.             // Create the list to use as the custom source.   
  29.             AutoCompleteStringCollection source = new AutoCompleteStringCollection();  
  30.             source.AddRange(new string[]  
  31.                     {  
  32.                         "January",  
  33.                         "February",  
  34.                         "March",  
  35.                         "April",  
  36.                         "May",  
  37.                         "June",  
  38.                         "July",  
  39.                         "August",  
  40.                         "September",  
  41.                         "October",  
  42.                         "November",  
  43.                         "December"  
  44.                     });  
  45.   
  46.   
  47.             // Create and initialize the text box.  
  48.             TextBox textBox = new TextBox();  
  49.   
  50.   
  51.   
  52.   
  53.             textBox.AutoCompleteCustomSource = source;  
  54.             textBox.AutoCompleteMode =  
  55.                 AutoCompleteMode.SuggestAppend;  
  56.             textBox.AutoCompleteSource =  
  57.                 AutoCompleteSource.CustomSource;  
  58.             textBox.Location = new Point(20, 20);  
  59.             textBox.Width = ClientRectangle.Width - 40;  
  60.             textBox.Visible = true;  
  61.   
  62.   
  63.   
  64.   
  65.             // Add the text box to the form.  
  66.             Controls.Add(textBox);  
  67.             //comboBox1.DropDownHeight = 300;  
  68.         }  
  69.     }  

C# 仿百度自动匹配,布布扣,bubuko.com

C# 仿百度自动匹配

标签:strong   width   art   cti   for   io   

原文地址:http://www.cnblogs.com/lijiu/p/3832124.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!