Jump to content

create frames


jahlxx

Recommended Posts

If "cloning" the visual components is sufficient you can try serializing/deserializing the frame. If you need to preserve the data (and non-visual components, i.e. datasets) you need to to it by hand, and it may be very hard.

For serializing the components see

 

http://docwiki.embarcadero.com/CodeExamples/Berlin/en/ComponentToString_(Delphi)

 

Beware, this process is possible only in Delphi. I tried in C++ and never succeeded.

Link to comment
Share on other sites

Hi.

 

Is not exactly what I'm looking for.

 

Now, for every form I have 4 files:

 

- 2 files for the form (.pas, and .dfm)

- 2 files for the frame where I am going to load the form. other .pas and.dfm for the frame

 

I'd like to have only one frame crated, and create frames in run time, as a copy of that frame, but I dont know how to do it.

 

Now, I'm doing as I explain above, the files of the frame are very little, but I think it could be more clear having only the files for the form and create the frame in run-time.

 

somme help and / or idea, will be wellcome.

 

thanks.

Link to comment
Share on other sites

  • 1 year later...

Hi all.

 

I have this:

 

var
   xfrc: Tfpframe;
 

 

And this piece of code only works the 1st. time that is excuted:

 

      xfrc := Tfpframe.Create(self);
      xfrc.Align := alClient;
      xfrc.Parent := Ts;
 

 

The 2nd. time, raises the error: A Component names fpframe already exists.

 

Any Idea?

 

Thanks.

Link to comment
Share on other sites

I answer myself:

 

I think the problem is the owner of the frame.

 

If I do this, works.

 

xfrc := Tfpframe.Create(Ts);
xfrc.Align := alClient;
xfrc.Parent := Ts;

 

 

Is correct?

 

Any other best way to do it?

 

Thanks.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...