这个很好解决啊,把分都给我吧,哈哈 具体问题,具体分析啊,看你要怎么得到这个接点的TTreeNode啊,如果是想单几得到的话,代码如下: //函算返回一个你在treeview1里单几得到的TTreeNode function TForm1.getNode:TTreeNode; begin Result := TreeView1.Selected end;如果是不要自己去选择,要程序去判断,代码如下:function TForm1.getNode:TTreeNode; var thisnode : TTreeNode; begin thisnode := TreeView1.Items.GetFirstNode; while thisnode<>nil do begin if thisnode.text = '我的程序' then begin Result := thisnode;//得到你要的TTreeNode; break; end; thisnode := thisnode.getnode; end; Result := nil; end;
具体问题,具体分析啊,看你要怎么得到这个接点的TTreeNode啊,如果是想单几得到的话,代码如下:
//函算返回一个你在treeview1里单几得到的TTreeNode
function TForm1.getNode:TTreeNode;
begin
Result := TreeView1.Selected
end;如果是不要自己去选择,要程序去判断,代码如下:function TForm1.getNode:TTreeNode;
var
thisnode : TTreeNode;
begin
thisnode := TreeView1.Items.GetFirstNode;
while thisnode<>nil do
begin
if thisnode.text = '我的程序' then
begin
Result := thisnode;//得到你要的TTreeNode;
break;
end;
thisnode := thisnode.getnode;
end;
Result := nil;
end;