Board index » delphi » How to save all?

How to save all?

Hello,

i.ve got a problem.
I'm a newbee with delphi.

How can I make a save all menu option (with code)
in a MDI form.
I want to save the contents of the memo component to
disk.
The memo-component is on a MDIChild form.
I've already got a Save function in de Child form.

Now I want to save all the Child with one button/menu option.

Please help,

Raimond Laan

 

Re:How to save all?


Quote
rml...@cs.vu.nl (Laan RM) wrote:
>Hello,
>i.ve got a problem.
>I'm a newbee with delphi.
>How can I make a save all menu option (with code)
>in a MDI form.
>I want to save the contents of the memo component to
>disk.
>The memo-component is on a MDIChild form.
>I've already got a Save function in de Child form.
>Now I want to save all the Child with one button/menu option.

I think something like this should work.  I haven't tested it so you
may have to fool around with it a little bit.

procedure TMainForm.miSaveAllClick(Sender: TObject);
var
   WorkForm: TForm;
   i: integer;
begin
for i:=0 to MDIChildCount-1 do
begin
   WorkForm:=MainForm.MDIChildren[i];
   with WorkForm as TChildForm do
           Save1.Click;
   end;
end;

-------------------------------
Thomas Paul
TOMG...@Pipeline.Com
Dean Witter, Discover & Co.
New York City, NY USA
----------------------------------

Other Threads