How to set node height in Tvirtualstringtree

I set the height of FocusedNode using the following code

 procedure TMainForm.SetheightClick(Sender: TObject); begin if Assigned(tree1.FocusedNode) then Tree1.NodeHeight[Tree1.FocusedNode] := strtointdef(edit8.Text ,50); end; 

I would like to set the Tvirtualstringtree height to multi-element nodes. How to do it?

+5
source share
1 answer

It is not possible to adjust the node height for selected nodes in a single call, so I think you only ask for an iteration of the selected nodes. Thus, to adjust the height for all selected nodes, you can write, for example:

 var Size: Cardinal; Node: PVirtualNode; begin Size := StrToIntDef(Edit8.Text, 50); Tree1.BeginUpdate; try for Node in Tree1.SelectedNodes do Tree1.NodeHeight[Node] := Size; finally Tree1.EndUpdate; end; end; 
+7
source

Source: https://habr.com/ru/post/1275389/


All Articles