Function FatherNode(Node:TTreeNode):TTreeNode; //查找父结点
var mynode,myposnode:TTreeNode;
begin
//递推算法
mynode:=node;
myposnode:=mynode.getPrevSibling ;
while not(myposnode=nil) do
begin
mynode:=myposnode;
myposnode :=mynode.getPrevSibling ;
end;
myposnode:=mynode.GetPrevVisible;
if not (myposnode=nil) then
Mynode:=myposnode
else
Mynode:=node;
result:=MyNode;
end;
子节点你就根据node.index可以获得了。