0
votes

The standard Windows/MFC ComboBox (dropdown-mode) has an auto-complete feature that I'd like to turn off, but don't know how.

Example 1: Create a ComboBox with the list values "Abc" and "Def". Enter "A" as edit value and use the drop-down-button. "A" will be changed to "Abc".

Example 2: Same start values. Open the drop down, enter "A" as edit value and press TAB. "A" will be changed to "Abc".

These examples even work in the Visual Studio IDE dialog editor test mode. No compiled exe needed.

The change from "A" to "Abc" is probably a feature, but it's not wanted by the customer. Is there any way to prevent it?

1
Solved it more or less my writing my own almost-like-a-combo-box...user178379

1 Answers

0
votes

You can finetune autocomplete behavior of any Edit control by calling SHAutoComplete. To get a handle to the Edit control part of a ComboBox send a CBEM_GETEDITCONTROL message to the ComboBox control.

To remove the unwanted feature the flags for SHAutoComplete must not include SHACF_USETAB.