遍历树查找
function blTree(const NodeCaption: string): TTreeNode;
function GetNode(node: TTreeNode): TTreeNode;
var
I:integer;
begin
Result := nil;
if node.Text = NodeCaption then
begin
Result := node;
Exit;
end;
for I:=0 to node.Count-1 do
begin
GetNode(node.Item[i]);
end;
end;
var
I:integer;
begin
Result := nil;
for I:=0 to TreeView.Items.Count-1 do
begin
Result := GetNode(TreeView.Items.Item[i]);
if Result <> nil then Break;
end;
end;
本文来自博客园,作者:{咏南中间件},转载请注明原文链接:https://www.cnblogs.com/hnxxcxg/archive/2010/11/25/2940664.html