delphidelphi-xe3virtualtreeview

How to Simulate TListView(vsIcon mode) with Virtual TreeView


I am using Delphi XE3. Now I try to simulate TListView(vsIcon mode) with Virtual TreeView. Is that possible? Basically this is:

(1) A tree with only root nodes. That is easy to implement. Just use the following codeline is OK:

VirtualTreeView1.RootNodeCount := 5;

(2) Hide the tree lines. That is also easy to do, just set toShowRoot option to False can hide all the tree lines for the root nodes.

(3) Each root nodes is displayed with only icon instead of text. That can be implemented with OnGetImageIndex vent together with an image list assigned to the tree view.

(4) There is only one column. That is also easy. By default there is only one column.

(5) The nodes should be tiled from left to right, horizontally, instead of vertically.

The (5) point is the one that I cannot figure out how to implement. I try to do the following researches:

  1. I try to check the TreeOptions and other properties, but cannot find one that support that feature.

  2. I try to search online, and find the following articles:

How to display an icon or image in a column of TVirtualStringTree? (This use multi-column)

Icon position in Virtual Treeview (This does not discuss tiling of nodes horizontally.

Delphi - ListView or similar with owner draw button ( THis also tile the nodes vertically)

  1. I then try to search keyword horizontally in the help document of Virtual TreeView, but what I get are all about how to scroll horizontally, not tile node horizontally.

I think I have tried my best to find a solution but failed. That is the reason why I ask on stackoverflow.


Solution

  • I don't think this is possible, at least Virtual TreeView was never designed to do this. It is a tree control that supports columns.