AutoComplete textbox

Satyapriyanayak
Posted by Satyapriyanayak under C# category on | Points: 40 | Views : 1004
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace Search_Edit
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
AutoCompleteStringCollection names = new AutoCompleteStringCollection();
private void Form2_Load(object sender, EventArgs e)
{
names.Add("Raj");
names.Add("Pintu");
names.Add("Shakti");
names.Add("Montu");
names.Add("Praveen");
names.Add("Chintu");
names.Add("Ram");
textBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
textBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;
textBox1.AutoCompleteCustomSource = names;
}
}
}

Comments or Responses

Login to post response