Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 May : TTreeNode.HasChildren does'nt work when node is collapsed
| Subject: | TTreeNode.HasChildren does'nt work when node is collapsed |
| Posted by: | "Frederic Larsen" (fredericlars..@hotmail.com) |
| Date: | 5 May 2005 05:27:35 |
I've created a function to save a TTreeView to a file. The problem is just that if a node is collapsed, the code does'nt get the childs.
(Using Delphi7 Enterprise)
The code so far:
if Node.HasChildren then //Problem occures here (I think)
begin
TN := Node.getFirstChild;
TLR := Result;
repeat
TLR := WriteNode(TN, TLR);
T := T + IntToStr(TLR.Number) + '&';
TN := Node.GetNextChild(TN);
until TN = nil;
Ini.WriteString(S, 'SubNodes', T);
end
else
begin
Ini.WriteString(S, 'SubNodes', 'NONE');
end;