ClistCtrl - centralize image
-
I have ClistCtrl (report view) with images. I want the images to be at the center of the column, not at left of the column. How can I centralize the images?
You will need to use 'custom draw', a feature of the common controls including the list control. You can find information in the MSDN using "custom draw" as the search string. I would post a direct link for you, but the MSDN site seems to be acting up at the moment :suss:. Custom draw lets you perform some or all of the drawing required for the control. It's easier than the 'owner draw' feature the traditional controls implemented, where you have to draw the whole thing. With 'custom draw' you can have the control do the standard drawing, and then add your piece where appropriate.
Software Zen:
delete this;
-
You will need to use 'custom draw', a feature of the common controls including the list control. You can find information in the MSDN using "custom draw" as the search string. I would post a direct link for you, but the MSDN site seems to be acting up at the moment :suss:. Custom draw lets you perform some or all of the drawing required for the control. It's easier than the 'owner draw' feature the traditional controls implemented, where you have to draw the whole thing. With 'custom draw' you can have the control do the standard drawing, and then add your piece where appropriate.
Software Zen:
delete this;
-
You will need to use 'custom draw', a feature of the common controls including the list control. You can find information in the MSDN using "custom draw" as the search string. I would post a direct link for you, but the MSDN site seems to be acting up at the moment :suss:. Custom draw lets you perform some or all of the drawing required for the control. It's easier than the 'owner draw' feature the traditional controls implemented, where you have to draw the whole thing. With 'custom draw' you can have the control do the standard drawing, and then add your piece where appropriate.
Software Zen:
delete this;
-
Thank you! I understand how can I change the font of text for example, by custom draw. But while I process the message of drawing an image, how can I draw the image (icon) at the center of the column?
If you know the dimensions of the icon, you can center it based on the
RECT
passed to the custom draw handler. Use the::DrawIcon
function to draw the icon.
Software Zen:
delete this;