Read-Only ComboBox
-
I've been trying to find of a working sample, but no luck! I only managed to find MFC samples. If someone knows how to get one in place by logic or a sample for it in Windows API code.
-
I've been trying to find of a working sample, but no luck! I only managed to find MFC samples. If someone knows how to get one in place by logic or a sample for it in Windows API code.
Depends what you mean by read-only. If you want the user to select from the drop-down list but not enter anything that is not on the list, then set the ComboBox style to CBS_DROPDOWNLIST (That's the name in winuser.h - your framework may have a different name). Cheers, Peter
Software rusts. Simon Stephenson, ca 1994.
-
I've been trying to find of a working sample, but no luck! I only managed to find MFC samples. If someone knows how to get one in place by logic or a sample for it in Windows API code.
What do you mean with "read only combobox"? If you mean a combobox whose content cannot be changed by the user, simply disable it (it becames grayed, but there is not other way, however you can make it ownerdrawn and draw it with normal colors either if it is disabled). If you mean a combobox where the user cannot type characters, but only select from a pre-defined list, use the
CBS_DROPDOWNLIST
style.