Solved

About OpenDialog

Posted on 1999-01-06
3
276 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now