David Smith wrote:
> procedure Form1.savePanelComps;
> var
> i: word
> begin
> For i := 0 to Form1.Componentcount-1 do
> If Form1.Components[i].parent = MyPanel
> WriteComponentRes(whatever..)
> end;
>
> --- heromed <[EMAIL PROTECTED]> wrote:
>
> > I have managed to save and restore all components on
> > a form (including
> > the form itself) using WriteComponentRes and
> > ReadComponentRes.
> >
> > I would like to save and restore ONLY components
> > that are owned by a
> > TPanel or TScrollBox.
> >
> > How do I do that ?
> >
> >
> >
> >
> >
> >
>
>
>
>
> __________________________________________
> Yahoo! DSL Something to write home about.
> Just $16.99/mo. or less.
> dsl.yahoo.com
>
>
>
> -----------------------------------------------------
> Home page: http://groups.yahoo.com/group/delphi-en/
> To unsubscribe: [EMAIL PROTECTED]
>
>
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
> * Visit your group "delphi-en
> <http://groups.yahoo.com/group/delphi-en>" on the web.
> * To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------------------------------------------------
>
>------------------------------------------------------------------------
>
>No virus found in this incoming message.
>Checked by AVG Free Edition.
>Version: 7.1.371 / Virus Database: 267.14.7/214 - Release Date: 23/12/2005
>
>
Thanks for your prompt reply. A happy Festive Season to You and Yours!
Maybe ReadComponentRes only loads(creates) forms but not other components.
I have tried the following simple program but got the message: "Property
TabOrder does not exist".
I have attache the saved file, but it seems OK.
-----------------------------------------------------------------------------------------
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, ExtCtrls, Menus;
type
TForm1 = class(TForm)
ClearButton: TButton;
savebutton: TButton;
loadbutton: TButton;
Edit1: TEdit;
procedure ClearButtonClick(Sender: TObject);
procedure savebuttonClick(Sender: TObject);
procedure loadbuttonClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
FileStream: TFileStream;
implementation
{$R *.dfm}
procedure TForm1.savebuttonClick(Sender: TObject);
begin
FileStream := TFileStream.Create('bob.txt',fmCreate);
try
FileStream.WriteComponentRes('',Edit1);
finally
FileStream.Free;
end;
end;
procedure TForm1.ClearButtonClick(Sender: TObject);
begin
edit1.destroy;
end;
procedure TForm1.loadbuttonClick(Sender: TObject);
begin
FileStream := TFileStream.Create('bob.txt',fmOpenReadWrite);
try
FileStream.ReadComponentRes(Form1);
finally
FileStream.Free;
end;
end;
initialization
RegisterClass(TEdit);
end.
------------------------------------------------------------------------------------------------------------------
Regards
Bob Stanton
----------
ÿ
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~->
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/