Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ComboBox Behavior

When presenting a fixed list of countries in a ComboBox control, with no free text entry, the user expectation is that if they begin spelling out the name of the country, it will take them to that country name. Instead, the default behavior is for it to move to the first item in the list that begins with that character. So, when they hit the second character of the name, it takes them to the first country beginning with that letter.

For example, if I press "S" a bunch of times, it lets me scroll through all of the countries beginning with "S" to get to Singapore. If I press "S", "I", "N", it takes me the first country starting with "S", then the first country starting with "I", then the first country starting with "N". I'd rather have "S", "I", "N" take me to countries beginning with "Sin"

Is there an easy way to enable that latter behavior?

like image 418
MattMcKnight Avatar asked Oct 14 '22 06:10

MattMcKnight


1 Answers

You can get this by setting the following properties on the combobox

AutoCompleteMode = Suggest
AutoCompleteSource = ListItems
DropDownStyle = DropDownList

Now, they can't be slacking and typing real slow...but if they type at a reasonable speed it will jump down to what they need.

If they are slow, it will behave like you mentioned

like image 181
curtisk Avatar answered Oct 20 '22 16:10

curtisk