...den String-Pfad in einem Treeview ermitteln?

Autor: L.Saenz
Homepage: http://www.geocities.com/lsaenz

Kategorie: VCL

{*---------------------------------------------
 Parent Text
 ---------------------------------------------*}

function SrNodeTree(pTreeNode: TTreeNode; var sRuta: string): string;
begin
  
sRuta := pTreeNode.Text + ' > ' + sRuta;
  if pTreeNode.Level = 0 then Result := sRuta
  else 
    
Result := SrNodeTree(pTreeNode.Parent, sRuta);
end;

{*---------------------------------------------
  Click an Item
 ---------------------------------------------*}
procedure TForm1.TreeView1Click(Sender: TObject);
var
  
sPath: string;
begin
  
label1.Caption := SrNodeTree(TreeView1.Selected, sPath);
end;

 

printed from
www.swissdelphicenter.ch
developers knowledge base