Hello, I need to know how to store and load two different icons for each node in the virtual tree component , also the two icons are different in size
Thanks
Hello, I need to know how to store and load two different icons for each node in the virtual tree component , also the two icons are different in size
Thanks
Unless you're going to owner-draw the whole thing, no control I'm aware of supports heterogeneous icon sizes, Virtual Treeview include. All icons for a given view are taken from a single TImageList
control, and TImageList
only supports one image size at a time.
You can make the icons appear to have different sizes by making the image size be that of the larger icon, and then painting the smaller icons onto larger icons that happen to be padded with transparent borders.
If you only need to support one icon size at a time, then you can maintain two separate TImageList
controls. When you want to switch sizes, reassign the tree control's ImageList
property. You may also need to adjust the DefaultNodeHeight
property, along with the heights of all the nodes that already exist.