Owner drawn List box...problem in setting item height.
-
Hi all. In an owner drawn list box, when I try to set the item height by ... -------------------------------------------------------------------- void CListBoxEx::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct) { lpMeasureItemStruct->itemHeight = m_nHeight; } -------------------------------------------------------------------- I have defined m_nHeight as a class memner and its of an int type. I am setting its value with the help of another function... SetItemHeight(int nVal). When I pass the values for m_nHeight to be greater than 255, then the values got truncated... Eg. 1. When I passed 300, the item height was set to 300-256 = 49. 2. When I passed 400, the item height was set to 400-256 = 149. etc. I have taken care to set the proper data types for m_nHeight, and data type of lpMeasureItemStruct->itemHeight is UINT. Then what could be the reason behind this value truncation? Thanks
Sameer Thakur
-
Hi all. In an owner drawn list box, when I try to set the item height by ... -------------------------------------------------------------------- void CListBoxEx::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct) { lpMeasureItemStruct->itemHeight = m_nHeight; } -------------------------------------------------------------------- I have defined m_nHeight as a class memner and its of an int type. I am setting its value with the help of another function... SetItemHeight(int nVal). When I pass the values for m_nHeight to be greater than 255, then the values got truncated... Eg. 1. When I passed 300, the item height was set to 300-256 = 49. 2. When I passed 400, the item height was set to 400-256 = 149. etc. I have taken care to set the proper data types for m_nHeight, and data type of lpMeasureItemStruct->itemHeight is UINT. Then what could be the reason behind this value truncation? Thanks
Sameer Thakur
-
from MSDN [^]: The maximum height of a list box item is 255. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.