Solved

About OpenDialog

Posted on 1999-01-06
3
278 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
  • 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

785 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