List box customization..Problem with setting the item Height.
-
Hi all. I am trying to customize a List box to load the jpg preview images in it. I have managed to load all the jpg files in a list box; one below the other from the selected location. But by default the preview height is 16 pixels. I tried to change it to 200 by following way… void CListBoxEx::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct) { lpMeasureItemStruct->itemHeight = 200; } but the height is remaining the same (16 pixels). How can I set the height to the desired pixel amount? Thanks
Sameer Thakur
-
Hi all. I am trying to customize a List box to load the jpg preview images in it. I have managed to load all the jpg files in a list box; one below the other from the selected location. But by default the preview height is 16 pixels. I tried to change it to 200 by following way… void CListBoxEx::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct) { lpMeasureItemStruct->itemHeight = 200; } but the height is remaining the same (16 pixels). How can I set the height to the desired pixel amount? Thanks
Sameer Thakur
Did you create your ListBox with Owner-draw style (LBS_OWNERDRAWVARIABLE)? If not try creating with the style.
-
Did you create your ListBox with Owner-draw style (LBS_OWNERDRAWVARIABLE)? If not try creating with the style.
Yes I have set the property of "Owner Draw" to "variablr" under style tab. Also checked the option of "Has String" under it.
Sameer Thakur
-
Yes I have set the property of "Owner Draw" to "variablr" under style tab. Also checked the option of "Has String" under it.
Sameer Thakur
In WM_DRAWITEM handler, did you set the property CtlType of DRAWITEMSTRUCT to ODT_LISTBOX?
-
In WM_DRAWITEM handler, did you set the property CtlType of DRAWITEMSTRUCT to ODT_LISTBOX?
No initialy I did not. But I have added it now but still the item size is not getting changed.
Sameer Thakur