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?
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 aCBEM_GETEDITCONTROL
message to the ComboBox control.To remove the unwanted feature the flags for
SHAutoComplete
must not includeSHACF_USETAB
.