[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 288
  • Last Modified:

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,
0
frw
Asked:
frw
  • 3
  • 2
1 Solution
 
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
 
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
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now