1

I have been trying to add Data items for my combobox in the DialogWindow of my mfc project, at design time by setting strings delimited by semi-colons for the Data property of this combobox.

But it just shows empty combobox at runtime. I tried using AddString() method of this combobox manually in the OnInitDialog() event of the DialogBox too. But that was also not working.

Tried creating a demo project again and when I added the combobox and put the value a;b in the Data property of it, it is showing up. But tried the same on my project and it is still showing the empty list in the new combobox! Tried to compare both project's code, like the header files and initialization's etc. Found that both are same. Other than some event declaration for the buttons and my custom c++ code in my project, the rest of the code is same as that of the newly created demo project!

Why in my project this combobox is showing an empty list of items? :(

EDIT:

Just noticed that the items are already in the list. But the dropdown is of small height and thus preventing the actual items from showing up! :(

Tried to look increasing the size of the combobox, but I couldn't find any property in the Property Window and dragging the corners of th combobox doesn't increases the height either! :(

2
  • By any chance you combobox is a "own drawn"?
    – cha
    Dec 3, 2013 at 11:46
  • @cha, means? I just noticed that the items are succeffully adding in the combobox list. But the dropdown list is not showing up in a good height. I think the dropdown list is of showing the list height in 1px or something!
    – Vpp Man
    Dec 3, 2013 at 11:51

1 Answer 1

7

Increase the size of the dropdown list like this, in the design window:

enter image description here

Click on the arrow on the right side of the combobox (highlighted in yellow on first pic). Then click and drag the bottom mid resize marker to increase the height (highlighted in the second pic).

This will increase the size of the dropdown list.

Otherwise when we try to click on the resize markers to increase the height, it would be disabled. So make sure you click on the arrow on the right side of the combobox first.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.