Solved

About OpenDialog

Posted on 1999-01-06
3
281 Views
Last Modified: 2010-04-04
How can I find out how many files are selected when I use OpenDialog for opening files?
0
Comment
Question by:mmilan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
williams2 earned 30 total points
ID: 1355006
That's actually easy enough:

This will do the trick:

procedure TForm1.Button1Click(Sender: TObject);
var
  i: Integer;
begin
  If OpenDialog1.Execute then
  With OpenDialog1 do
    For i:= 0 to Files.count-1 do ShowMessage(Files[i]);
end;

Regards,
Williams
0
 
LVL 17

Expert Comment

by:inthe
ID: 1355007
hi here is another way
procedure TForm1.Button1Click(Sender: TObject);
var
a:integer;
begin
opendialog1.Execute;
a:=opendialog1.Files.Count;
showmessage(inttostr(a));
end;

Regards Barry
Williams your too fast  :-)
0
 
LVL 3

Expert Comment

by:williams2
ID: 1355008
Hi Barry, you gotta be fast at this site. The last 5 times I wrote answers, somebody came up before me :-) ..but I guess this will clear up things:

That's actually easy enough:

This will also do:

procedure TForm1.Button1Click(Sender: TObject);
begin
  Memo1.Clear;
  If OpenDialog1.Execute then
    memo1.Lines.AddStrings(OpenDialog1.Files);
end;  

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question