0
votes

I am trying to set height for each item present in CComboBox drop list. I have setitemheight API but it is not changing height of each item in list. I have used SetFont as well but no automatic resizing either. check image for issue with height

1
Did you try SetItemHeight?sergiol
To have variable height items you must set the CBS_OWNERDRAWVARIABLE style and be prepared to respond to WM_MEASUREITEM and WM_DRAWITEM messages.Jonathan Potter

1 Answers

0
votes

Problem seems like I have overridden DrawItem , hence I have made minor change there to fix issue:

GetLBText(lpDrawItemStruct->itemID, strText);
lpDrawItemStruct->rcItem.bottom += 2;  // this solved my problem
dc.ExtTextOutW(
                lpDrawItemStruct->rcItem.left,
                lpDrawItemStruct->rcItem.top,
                ETO_OPAQUE,
                &lpDrawItemStruct->rcItem,
                strText,
                strText.GetLength(),
                NULL
                );