?
Solved

comboboxes and listboxes

Posted on 1999-01-11
9
Medium Priority
?
151 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
Technology Partners: 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month8 days, 15 hours left to enroll

764 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