1

I am using a class that is the descendant of CComboBox. The problem occurs when I call the CComboBox::SetItemHeight method to set the height of my combobox items using the following code:

m_searchComboBox.SetItemHeight(0,17);

It sets the height of Items but the height of the control (dropdown list) is also increased and the new height is larger than the height I set through Dialog Box. I also tried the following code:

m_searchComboBox.SetItemHeight(-1,17);

But that sets the height of the edit-control not the height of items. What should I do to set the height of Combobox items without disturbing the height of dropdown list?

Itban Saeed
  • 1,660
  • 5
  • 25
  • 38
  • Possible duplicate to http://stackoverflow.com/questions/16752486/how-to-change-the-apparent-height-of-a-combobox-control-with-the-dropdownlist-bu – xMRi Aug 20 '15 at 12:45
  • 1
    Actually the height of the list is another thing than the height of the items, but I would not wonder if Windows implicitly changes the one with the other. To fix this I would try setting the list's height explicitly after changing the items' height. The list's height in fact is defined by the combox box' height, so try m_searchComboBox.MoveWindow() with according values. (Probably I'm a bit late with this comment...) – Nick Oct 07 '19 at 15:22
  • Thank you so much for the response.. anyways, better late than never :) – Itban Saeed Oct 08 '19 at 09:40

0 Answers0