Question

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
Was it helpful?

Solution

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?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top