Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selecting an item in comboBox by typing

I've a combobox that has hundreds item in it. User must be able to type the text into the combobox . While the user is typing the text, the item that starting with the typed value must be selected or listed. The user must be able type continuously. My ComboBox DropDownStyle is DropDownList

Eg: While selecting a name in comboBox by typing, it only allows one letter. So if I type "A" it will jump to the first letter starting with "A". when i type continuously the combo box selected item changes according to the current keypress. if i press "As", combobox viewing the items starting with "s".

I'm using Win Forms.

thanks in advance..

like image 559
prabhuK2k Avatar asked Apr 17 '12 08:04

prabhuK2k


People also ask

Which method is used to get the selected item in ComboBox control?

The ComboBox class searches for the specified object by using the IndexOf method.

How do I make a ComboBox editable?

In this article we will see how we can make a combo box such that user and change the value of it by typing. By default when we create a combo box we can only choose from the option in the drop down menu although in editable combo box we can set the text by our self.


1 Answers

comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown; comboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend; comboBox1.AutoCompleteSource = AutoCompleteSource.ListItems; 
like image 122
prabhuK2k Avatar answered Sep 23 '22 05:09

prabhuK2k