We help IT Professionals succeed at work.

Customizing the CTreeCtrl drawing...

FMayis asked

I'd like to create a new CTreeCtrl class, that allows the user to specify for each added item, not the index of the image in the resource but a bitmap path name.

Then, on drawing, i'd like to stretch the bitmap to have it like the normal mage of any item.

The problem is that i don't really know how?

Do i have to overload the paint function?
Do i have to create entirely the control? :(

Can someone give me some help, ideas, and known ips for this kind of job?

thanks a lot!
Watch Question

The Tree Control supports custom drawing, with notifications sent at various stages of drawing, where you can add your own drawing code and respond with "do the default" or "don't do anything" etc.

See MSDN for Platform SDK/User Interface Services/Windows Common Controls/Customizing a controls appearance
However, it might be easier to generate the Image list dynamically from the specified bitmaps, and then use the default handling.



i create dynamically the list and it works!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.