在自绘listBox的时候,当在MeasureItem中用 lpMeasureItemStruct->itemHeight = 400 指定高度时,发现如果值过大,则在DrawItem绘制的时候pDIStruct->rcItem.bottom值只有144,请问这是为什么?如何能解决?

解决方案 »

  1.   

    itemHeightSpecifies the height of an individual item in a list box or a menu. Before it returns from the message, the owner of the owner-draw combo box, list box, or menu item must fill out this member. The maximum height of a list box item is 255.
    请看,高的最大值为255,显然是一个字节大小。如果超过255,那么超过255,就会溢出了。显然,400会溢出,那么溢出后剩下的数值就是400 - 256 = 144了。