How to set the node height in Tvirtualstringtree
Asked Answered
Q

1

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?

Quiles answered 16/2, 2018 at 6:27 Comment(0)
R
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;
Ribose answered 16/2, 2018 at 6:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.