Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ComboBox problem 2

Status
Not open for further replies.

Bickle

Programmer
Jul 12, 2001
22
FR
I have a combobox control in a dilog project, I link it to the class MFC CComboList, when I use try to fill it with the method AddString in the method InitDialog of my dialog project, I never have any items in the list.
 
maybe U have them there, but U didn't set the size of the extracted list box (by clicking the [v] arrow and dragging down). or is it functionable ok, whe the items are aded from resource editor ?
 
Try this:
1. Select the combo box in the dialog editor press ctrl+w. In the ClassWizard go to MemberVaribiles and to your combo assign a member variabile lets say m_xCombo which should be of type CComboBox(not CComboList).
2. Add line in InitDialog
m_xCombo.AddString("whatever");
3. Go in the dialog editor, press on the arrow of the combo and then drag down the rectagle to allow your combo elements to be viewed (default is none). drag it let's say for four items.

Hope this helps,
s-)

Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top