简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM