comboboxes and listboxes

Hi experts,

with the help of a drivecombobox, filtercombobox,directorylistbox  and a filelistbox control I would like to create
a SAVE file dialogue. Can you please show me how this can be done with Delphi 3.0 ? In my books I unfortunately
find only examples for a LOAD file dialogue.


With kind regards

Mathes
mathesAsked:
Who is Participating?
 
viktornetConnect With a Mentor Commented:
You ust go to the palette with the dialog boxes and choose TSaveDialog or something then do this...

if SaveDialog1.Execute then
  MyItems.SaveToFile(SaveDialog1.FileName);

That's all...

-Viktor
--Ivanov
0
 
rwilson032697Commented:
Well, in terms of the UI they are basically identical except for the titles. When the execute method finishes you save a file rather than load one.

Cheers,

Raymond.
0
 
mathesAuthor Commented:
Dear rwilson,

thank you for your comment. Can you please provide me with a small demo program in order to clarify this thing ?

With kind regards

Mathes
0
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.

 
rwilson032697Commented:
You already have one! Its the load demo in your D3 book. Just change the title to 'Save...' and save a file instead of opening it!

Cheers,

Raymond.
0
 
ZifNabCommented:
Hi mathes,

like rwilson... if you already have a demo of a load dialog... then you can easely adjust it to save dialog...

Why? Normally a load dialog allows you to select a file name. A save dialog lets you to select one, or to fill in one...

So what's the difference? I the save dialog, you need only make it possible to write in the editbox where the selected file is written.. And change the title to save offcourse.

If the problem still persists, please paste some code or send the 'load'-demo to me.

Zif.
0
 
martin_gCommented:
Hi,
You do have a SaveDialog component already in Delphi 3 (as the other guys have mentioned).Look under the Dialogs components tab.  You just use SaveDialog1.Execute to start it (once you have dragged it to your form).

However, I was wondering what you were trying to save.  Are they files in memory but not on the harddrive yet? Therefore, they won't show up on your files list?  If that's the case, you might want to use a different approach.  Something I'm sure we can help you with if you want.  

Thanks for taking my "Two cents" worth!
Regards,
Martin
0
 
viktornetCommented:
oppps... Martin_G has mentioned something similar to what i have...****
0
 
viktornetCommented:
actually here is what you do...

OnFileListBoxDoubleClick()
begin
  SaveDialog1.FileName := FileListBox.Items[FileListBox.ItemIndex];
  if SaveDialog1.Execute then
     Memo.Lines.SaveToFile(SaveDialog1.FileName);
end;

That was an example.... It's more like of a pseude code since I don't have Delphi open... if you need more helkp with anything let me know....

-Viktor
--Ivanov
0
 
mathesAuthor Commented:
Hi experts,

thank you all for your help and comments.

Yes, the solution is really easy. I simply have to add a savedialog control and a
command button to a form, that is all I nbeed to do. When I click on the button,
I call the statement

SaveDialog1.Execute


and no further lines of code are required. I think I was confused by the drivecombobox,
filtercombobox, directorylistbox and filelistbox controls. I didn't realize that I don't
need these items in this case.
I guess this blackout was my problem. I am happy that this problem is solved now.


With kind regards

Mathes


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.