|Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread|
|Messages 1 to 6 of 6 total|
|How to clone or duplicate an object?|
|Mon, Oct 8 2012 6:12 AM||Permanent Link|
is it possible to clone or duplicate an object (e.g. a TPanel)?
Thanks in advance & Greetings ... Peter
Sorry for my weird english
|Mon, Oct 8 2012 11:35 AM||Permanent Link|
Am I missing something... How about Copy/Paste?
|Mon, Oct 8 2012 11:52 AM||Permanent Link|
I didn't even dare to ask.
It must be something more complicated.
|Mon, Oct 8 2012 12:49 PM||Permanent Link|
> Am I missing something... How about Copy/Paste?
LOL, Uli is right: I mean how to clone or duplicate an object
something like this:
myNewPanel := myExistingPanel.Clone();
Greetings ... Peter
|Mon, Oct 8 2012 1:12 PM||Permanent Link|
How about the same way you'd do it in Delphi
myNewPanel := TPanel.Create(self);
myNewPanel.Height := myExistingPanel.Height;
Roy Lambert [Team Elevate]
|Mon, Oct 8 2012 4:58 PM||Permanent Link|
<<is it possible to clone or duplicate an object (e.g. a TPanel)>>
I use this technique a lot, but only in classes that I have defined myself. If I often find myself wanting to create a new instance based on an existing instance then I add a CopyFrom method. For example:
TMyClass = class
procedure CopyFrom(const AClass: TMyClass);
The code in CopyFrom simply copies across the elements that make sense in the context of a "copy from" action. Not sure if this is what you mean?
This web page was last updated on
Wednesday, March 29, 2023 at 10:59 PM
© 2023 Elevate Software, Inc. All Rights Reserved
Questions or comments ? E-mail us at firstname.lastname@example.org