Click to See Complete Forum and Search --> : Storing elements in a combo box


Zulfi Khan
April 29th, 1999, 03:21 AM
I have a combo box in a dialog box. I have associated with a variable. I am trying to fill elements in the combo box. I have used the data option provided in the properties, SendDialogItem Method(no error but no effect) & also the m_combo.AddString(Error message) but none have worked. Can you pl. help me.

jschmidt
April 29th, 1999, 03:39 AM
AddString should work. You just pass a CString which is then added to the list. Remember to set the size of the dropdown list in resource editor by first clicking on the comboboxes dropdown arrow and than dragging the lower blue dot to size the list... What exactly doesn't work ? Getting any error message using AddString !??

April 29th, 1999, 03:49 AM
Do you get Error Message when you try to add strings thru AddString. Then please check the type of variable you have associated with the ComboBox control. It should be of type CComboBox.

Zulfi Khan
May 6th, 1999, 01:47 AM
Thanks its working.

Zulfi Khan
May 6th, 1999, 01:52 AM
Thanks for your help. Actually I was using the wrong type. How can we increase the size of combo box programatically?

BrianOG
May 6th, 1999, 03:01 AM
In orrder to set the drop down size, you just change the height of the combo. The height of the combo is actaull the height of the edit/static control and the drop down list. (Call GetWindowRect on it and observe the results). To change the height of the edit/static control you must use CComboBox::SetItemHeight(-1, nHeight);