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
Last edited by yaoliwei2000; May 30th, 2004 at 04:56 AM.
Since you specified different item's height ,I am guessing you used ownerdraw variable and not owner draw fixed? In the DrawItem function (or other places) you can use SetItemHeight to set the height of an item in pixels.
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().
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.