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?
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;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.