views:

293

answers:

1

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

+3  A: 

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.

Rob Kennedy
thanks alot, yes I know I have to draw every thing , if there is a sample for this would be great
william