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.
0
votes
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
);
SetItemHeight
? – sergiolCBS_OWNERDRAWVARIABLE
style and be prepared to respond toWM_MEASUREITEM
andWM_DRAWITEM
messages. – Jonathan Potter