I am building a application using FMX. This app will run on Windows, Mac OSX, and Linux.
I have a need to clone a TPanel which is contained in another TPanel.
Clone function provided in FMX is throwing an error:
Class TForm1 not found.
How to clone a TPanel in an FMX app?
Here is the code I am using:
procedure TForm1.Button1Click(Sender: TObject);
CurrentControl, ClonedControl: TFMXObject;
CtlrNameCnt := IntToStr(Panel1.ControlsCount);
CurrentControl := Panel1;
ClonedControl := Clone(CurrentControl); //<- this gives error
ClonedControl.name := CurrentControl.name + ‘_’ + CtlrNameCnt;
ClonedControl.Parent := Panel1;