?
Solved

comboboxes and listboxes

Posted on 1999-01-11
9
Medium Priority
?
154 Views
Last Modified: 2010-04-06
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
0
Comment
Question by:mathes
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1355892
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
 

Author Comment

by:mathes
ID: 1355893
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
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1355894
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 8

Expert Comment

by:ZifNab
ID: 1355895
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
 
LVL 1

Expert Comment

by:martin_g
ID: 1355896
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
 
LVL 10

Accepted Solution

by:
viktornet earned 40 total points
ID: 1355897
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
 
LVL 10

Expert Comment

by:viktornet
ID: 1355898
oppps... Martin_G has mentioned something similar to what i have...****
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1355899
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
 

Author Comment

by:mathes
ID: 1355900
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Screencast - Getting to Know the Pipeline
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month17 days, 9 hours left to enroll

829 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