Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the node height in Tvirtualstringtree

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?

like image 975
u950321 Avatar asked Feb 16 '18 06:02

u950321


Video Answer


1 Answers

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;
like image 103
Victoria Avatar answered Sep 19 '22 14:09

Victoria