AutoCompleteStringCollection Class Contains a collection of strings to use for the auto-complete feature on certain Windows Forms controls.
using System;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Text;
usingSystem.Windows.Forms;
namespaceAutoCompleteSample
{
public partial class Form1 : Form
{
publicForm1()
{
InitializeComponent();
}
privatevoid Form1_Load(objectsender, EventArgs e)
{
comboBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;
comboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
// AutoCompleteStringCollection
AutoCompleteStringCollectiondata = new AutoCompleteStringCollection();
data.Add("Chaitanya");
data.Add("Kranthi");
data.Add("Shakti");
data.Add("Kasani");
data.Add("Kumar");
data.Add("Ramachandra");
data.Add("Rambabu");
data.Add("Ramkishore");
data.Add("Praveen");
data.Add("Venkatesh");
data.Add("Venkatesh");
data.Add("Niyantha");
data.Add("Sunny");
data.Add("Vaishanv");
data.Add("Koushik");
data.Add("Prashath");
data.Add("Mahesh");
data.Add("LakshmiKanth");
data.Add("Ramu");
data.Add("Ajay");
data.Add("Vijay");
data.Add("Hemanth");
data.Add("Chenna");
data.Add("Krishna");
data.Add("Keerthi Ramanjaneyulu");
data.Add("Ali Najer");
comboBox1.AutoCompleteCustomSource = data;
}
}
}
Output:-
When I Run The Application And Click On The Combobox No Data Is Find As Follows:
But When We Type Any Word In The Combobox Then It Will Show The AutoComplete Feature As Follows :
No comments:
Post a Comment
Note: only a member of this blog may post a comment.