Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

comboboxes and listboxes

Posted on 1999-01-11
9
Medium Priority
?
152 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
[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
  • 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
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!

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

618 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