?
Solved

About OpenDialog

Posted on 1999-01-06
3
Medium Priority
?
288 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 120 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month9 days, 17 hours left to enroll

762 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