I need a simple listbox control where height for each item varies. And then i to need draw a custom image for each item.
Basically item_height would be equal to (listbox_width / image_width ) * image_height.
Normally I would just take a listbox and specify on paint event, but i need a variable height for each item.
Is there a simple way to get a list box with items of variable height?
You can set the DrawMode property of your ListBox
control to OwnerDrawVariable and handle its MeasureItem and DrawItem events.
There is a MeasureItem
event. Don't forget to set DrawMode
to OwnerDrawVariable
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With