Link to home
Start Free TrialLog in
Avatar of x4u
x4u

asked on

Accessing a MFC combo box

Hi,

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.
SOLUTION
Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of x4u
x4u

ASKER

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.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of x4u

ASKER

Ahh, cool thanks. I would never have figuered this out myself. ;-)