1

I'd like some code to do the following with VirtualTreeView, considering I've never used it before:

  • Add x amount of items
  • Define static item size (x,y)
  • Items must work like ListView Icon mode, so that they are automatically spanned horizontally and vertically as necessary when the TreeView is resized, to accommodate all possible items within the current boundary
  • When an item needs to be painted, I need an event triggered which gives me a specific rect boundary and canvas where I can simply paste/draw a bitmap onto, so this has to trigger only when the item is to be displayed
  • Upon clicking an item, it has to trigger an event, giving me the item index, and drawing the appropriate selection box around it
hikari
  • 3,393
  • 1
  • 33
  • 72

1 Answers1

3

In short: you can't. Virtual tree view spans its items vertically and the only thing you can do is to display fake items using VTV's columns. Which is like shooting sparrows with bazooka. Why don't you use a listview control?

Spook
  • 25,318
  • 18
  • 90
  • 167
  • Listview isn't that handy, in Icon mode the image size is too small, and Tile mode isn't implemented in the default VCL (it is in Jedi's, but that doesn't seem fit for this purpose either). I thought maybe VTV could handle this task better. – hikari Dec 20 '12 at 06:18
  • I'll open a new question to try solving this with a normal LV. Thanks. – hikari Dec 20 '12 at 07:28
  • Removed new question, got it sorted. – hikari Dec 20 '12 at 07:48