I have an issue with the comboBox dropdown list. When I have similar items for example "R20 SysHealth" and "R20" in my list. When "R20" is the selected text and I click to show the dropdown list it hightlights the "R20 SysHealth" instead of "R20" so its not comparing the exact string. Has anyone come across this before? if not can you turn of the highlighting?
Asked
Active
Viewed 253 times
1
-
Does this answer your question? [CComboBox not selecting CurSel when dropped down](https://stackoverflow.com/questions/36502743/ccombobox-not-selecting-cursel-when-dropped-down) – Andrew Truckle May 17 '20 at 22:04
-
Please see my answer as I think this explains. – Andrew Truckle May 17 '20 at 22:04
1 Answers
0
You might want to use the FindStringExact
member method of CComboBox
instead of just FindString
.

thomiel
- 2,467
- 22
- 37
-
I do use FindStringExact to set the selected item in the Combo List which is fine. The issue is when you click the control and the drop down list appears it highlights the wrong item in the list as shown above. I'm assuming it within the ComboBox class code itself. – NOZ77 May 15 '20 at 09:01
-
Ok, I assumed you selected the item programatically... You should then opt to have the list sorted alphabetically. This way the RF20 would be selected first. – thomiel May 15 '20 at 11:43