to avoid user to "type" another string, just go to dialog GUI editor, select combo box properties, and change style to "Drop list" (not drop down)
Main Topics
Browse All TopicsHi,
1. how do I get the pointer/reference of a combo box object that I added in the MS VS 2003 GUI editor and that has got the ID "IDC_COMBO1"?
2. how do put some static strings into it's list?
3. how do I restrict the combo box to allow only the strings from the list (no manual typing)?
BTW, I'm a absolutely new to MFC and win32 but have got some C++ expirience.
Thank you for efforts.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Thank you, adding items works fine now.
But the drop down list height seems to be zero, it is appears only a thick black line. I can browse the items with the cursor keys but how do I resize the list box height to a reasonable height? Can I set set it to resize automatically somehow?
BTW, I get is the same behaviour with AddString and when I type the strings into data properties field.
About the control height, it is a common error:
Comboboxes have 2 height: Edit portion height and drop-down list height. You have not resized the second.
Go to dialog GUI editor, select your combobox, the bounding rectangle will be selected, now press on the drop-down arrow, a diferent rectangle will be selected, drag lower boundary to desired size. That's all.
Business Accounts
Answer for Membership
by: jaime_olivaresPosted on 2004-08-04 at 10:14:00ID: 11718075
go to ClassWizard (Ctrl-W)
select your dialog object
select the "member variables" tab
your control label will appear, select it
press the "Add variable" button, another dialog will appear
here is the trick: write a variable name and in the "category" choose "control"
now your dialog has a proper initialized member you can use to pass any message