procedure TzichanGuanliForm.mainTreeChange(Sender: TObject;
Node: TTreeNode);
var
begin
Listbox1.Items.Clear;
if not node.HasChildren then exit;
childNode := node.getFirstChild;
while childNode <> nil do
begin
listbox1.items.add(childnode.text);
childNode := node.GetNextChild(childNode);
end;
end
end;
在OnChange事件中写
var
i : integer;
TNode: TTreeNode;
begin
if Node.HasChildren then
begin
TNode :=Node.GetNext;
while TNode<>nil do
begin
ShowMessage(TNode.Text);
TNode :=TNode.getNextSibling;
end;
end;
end;