6

I have set the the height of the FocusedNode using 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 height of Tvirtualstringtree in multiselect nodes. How to do it?

Tom Brunberg
  • 20,312
  • 8
  • 37
  • 54
u950321
  • 195
  • 7

1 Answers1

7

There's no way to setup node height for selected nodes in one call, so I guess you're asking just for selected nodes iteration. So to setup height for all selected nodes, you can write e.g.:

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;
Victoria
  • 7,822
  • 2
  • 21
  • 44