Re: FTP.Directory Listing and TTreeView

Giganews Newsgroups
Subject: Re: FTP.Directory Listing and TTreeView
Posted by:  Remy Lebeau (TeamB) (gambit47.no.spam@no.spam.yahoo.com)
Date: Thu, 12 Feb 2004

"James A. Schulz" <jaschu…@wiseware.com> wrote in message
news:74E1CB4DBF91E240jaschu…@wiseware.com...
> Is there an example somewhere that shows how to put an
> IdFTPClient.DirectoryListing into a TTreeView?

You will have to loop through the listing adding items to the tree one at a
time.  For example:

    var
        ParentNode: TTreeNode;
        I: Integer;
    begin
        ParentNode := whatever;
        //...
        TreeView1.Items.BeginUpdate;
        try
            for I := 0 to IdFTP1.DirectoryListing.Count-1 do
            begin
                TreeView1.Items.AddChild(ParentNode,
IdFTP1.DirectoryListing[I].FileName);
            end;
        finally
            TreeView1.Items.EndUpdate;
        end;
    end;

Gambit

Replies

In response to

FTP.Directory Listing and TTreeView posted by James A. Schulz on Thu, 12 Feb 2004