if I'm not mistaken it's not possible to have invisible nodes in a TVirtualStringTree treeview, as there are no enabled, visible or other properties to do so. Am I right about this?
If yes, how did I manage to have a non visible node?
Structure of my tree:
I can find Subnode 16 when I do a FirstNode/GetNextNode loop over the whole tree and let me print out the text for the first column. I can also inspect the node and see that he's got a previous sibling but no next sibling for instance and the node height is 18.
So how did I do this?
if I'm not mistaken it's not possible to have invisible nodes in a TVirtualStringTree treeview, as there are no enabled, visible or other properties to do so. Am I right about this?
You are wrong, it is possible to have both invisible and disabled nodes. To switch visible state of the node use
vtree.IsVisible[Node] := boolean;
to enable / disable node use
vtree.IsDisabled[Node] := boolean;
You can also initialize node to disabled state in tree's OnInitNode
event with adding ivsDisabled
to InitialStates
parameter.
In Addition to ains answer, to recurse the tree you can use the following functions:
To recurse ALL nodes
Tree.GetFirst();
Tree.GetNext();
Tree.GetPrevious();
To recurse only VISIBLE nodes:
Tree.GetFirstVisible();
Tree.GetNextVisible();
Tree.GetPreviousVisible();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With