TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
AutoComplete ComboBox in Visual C# 2010
Raj Kumar
Apr 21, 2010
76.8
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
This sample of code will show you how to use AutoComplete in Visua C# 2010.
This piece of code will tell how to AutoComplete a combo box using Visual C# 2010.
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;
namespace AutoCompleteComboBox
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.comboBox1.AutoCompleteCustomSource.AddRange
(new string[] {"Raj Beniwal", "Rohit Malhotra", "Ronit Singh", "Ravi Kumar",
"Rohit Behl", "Sanjay Singh", "Shalini Singh", "Seema Malhotra", "Savi Verma",
"Karan Kappor", "Kapil Malhotra", "Vikash Nanda", "Vikram Jain", "Amit Garg",
"Atul Wadhwani", "Ashwani Pandey"
});
this.comboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
this.comboBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;
}
}
}
Now run the application :
Next Recommended Reading
Adding a Setup Project in Visual Studio-2010