problem from owner draw CComboBox with different list items' height.
Hello gurus,
I have an owner draw CComboBox with different list items' height. On some cases, the list box of combo box will hold some empty place at the bottom if you drop down the combo box.
For example, In MeasureItem(), if you set item1's height to 20, item2's height to 10, then some empty place will be at the bottom of the dropeed list box, though for some items height pairs, there will be no empty place.
My question is: is there any way to set the height of the list box of the combo box? so that I can remove the empty place at the bottom.
Attach file is the simple test project.
Any idea is welcome.
Regards
Yao Liwei
not item height, but the list box's height which contains the list items.
Hi TDM,
thanks for your idea.
yes, it's a OWNERDRAWVARIABLE style combo box.
Nevertheless I don't mean the height of the single item, but the scroll heigh of the list box of the combo box when the combo box is dropped down.
The item height is set properly in OnMeasureItem() and works, the problems is there is some empty place below the last item in the dropped down list box.
I know there is one function called SetHorizontalExtent() of CComboBox to set the horizontal scroll width of the list box. So my question is: is there any kind of function to set the vertical scroll height of the list box, not the height of the list box control itself, like SetVerticalExtent().
1 Attachment(s)
screen shot of the problem.
screen shot of the problem.