Listbox Items

Hello,
I need some help on the following:
How would you load a list of files from
a current directory with a certain extension..Eg. myfile1.adr, myfile2.adr
etc. and then by selecting that item from the list (in the listbox) and load
the files contents into a memobox for
example.(note) file types are of text.
Regards,
frwAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

intheCommented:
answered in other duplicate question.
better delete this one.
Regards Barry
0
nicola65Commented:
procedure TForm1.Button1Click(Sender: TObject);
begin
  ListBox1.Items.Text:=FileListBox1.Items.Text;
end;

procedure TForm1.ListBox1DblClick(Sender: TObject);
var nomefile:string;
begin
  nomefile:=FileListBox1.Directory + listbox1.Items.Strings[listbox1.Itemindex];
  showmessage(nomefile);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
memo1.Lines.LoadFromFile(FileListBox1.Directory + listbox1.Items.Strings[listbox1.Itemindex]);
end;

Button1Click load the filel in the listbox, Button2Click load in memo the select file.
ListBoxDoubleClick show the file name.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
intheCommented:
this question has already been answered in other question .

the question was asked twice by mistake did you not see my comment saying to delete this one ??
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

ianBCommented:
frw ,

You have posted this question twice, you need to decide which question you want to keep and I will close the other one.

Please see :

http://www.experts-exchange.com/jsp/qShow.jsp?ta=commspt&qid=10253734 

when you next see this comment.

Ian
COmmunity Support @ Experts Exchange
0
nicola65Commented:
i dont understand !
where and how i can post twice this answer ?
Excuse me if it is !
0
intheCommented:
no the question was asked twice by mistake ,look on the delphi page under "locked questions" and you see 2 of this question.i answered the other copy last night and posted comment in this one(see first comment at top) to delete this copy else it costs frw twice the points.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.