Recent

Author Topic: TOPENDIALOG: How To USe it...  (Read 6563 times)

ecitoyen

  • Jr. Member
  • **
  • Posts: 51
TOPENDIALOG: How To USe it...
« on: August 12, 2010, 01:57:39 am »
TOpenDialog: How to use this dialog...

Now... i want to know how to use the Topen DIalog to
do the following task:

after myOKbutton has been pressed...
i validate some data and
after i want to choose a file in
a specific directory... C:\DirectoryFiles\

to select a file of any type and when the user
selected the file... i need the filename...

I know... That TOpenDialog did a part...of
this job... let the user to choose a file...
but in the current directory...
How tell to the TopenDIalog to open my C:\DirectoryFiles
for any filetype:  C:\DirectoryFiles\*.*

Thanks you

 ;D

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: TOPENDIALOG: How To USe it...
« Reply #1 on: August 12, 2010, 02:04:45 am »
Set Filter to *.* and InitialDir to c:\etc.

ecitoyen

  • Jr. Member
  • **
  • Posts: 51
Re: TOPENDIALOG: How To USe it...
« Reply #2 on: August 12, 2010, 02:49:15 am »
Yes, your ok... the problem i got... i'm sure... was that i does not see the
OpenDialog Property list... following the OpenDialog1.

You're great...
 :-[ :-[ :-[

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: TOPENDIALOG: How To USe it...
« Reply #3 on: August 12, 2010, 03:09:56 am »
Take a look at Object Inspector.

captian jaster

  • Guest
Re: TOPENDIALOG: How To USe it...
« Reply #4 on: August 12, 2010, 03:25:12 am »
And the filename..
For that Do OpenD.FileName
Putting OpenD. will bring up alot of different variables\ Property's to use

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: TOPENDIALOG: How To USe it...
« Reply #5 on: August 12, 2010, 03:31:55 am »
Write on the MenuItem click event handler:

if OpenDialog.Execute then
begin
   // here you can get the chosen filename, for example
   Memo.Lines.LoadFromFile(OpenDialog.FileName);

   // or load any other control you want
end;
« Last Edit: August 12, 2010, 04:01:40 am by typo »

 

TinyPortal © 2005-2018