Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populating a list view box with files.

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I want to use a list view box in conjunction with the directory object to list files. How can I populate a list view box with files from the specified directory?
 
How about using the 'TDirectoryListBox' component (as found on the Win3.1 VCL tabbed page) ?
Hope this is helpful ....
Steve
 
You could also try the Find... statements:

var f:TSearchRec;
begin
myListBox.Clear; { you'd want to start with an empty list}
if FindFirst('*.*',faAnyFile,f)=0
then repeat
myListBox.Items.Add(f.name);
until FindNext(f)<>0;
FindClose(f);
end;

That's for a more low-level programming... ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top