Esto es lo que estoy haciendo:
Código Delphi
[-]unit UnidadPrincipal;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Rtti, System.Classes,
System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs,
FMX.StdCtrls, FMX.Objects, FMX.Ani;
type
TFormPrincipal = class(TForm)
PanelBts: TPanel;
BtCorrespondencia: TSpeedButton;
Label1: TLabel;
Image1: TImage;
Image2: TImage;
PanelFormas: TPanel;
procedure BtCorrespondenciaClick(Sender: TObject);
procedure IncrustarForm(AParent:TControl; AForm:TCustomForm);
private
public
end;
var
FormPrincipal: TFormPrincipal;
implementation
{$R *.fmx}
Uses UnidadCorrespondencia;
procedure TFormPrincipal.BtCorrespondenciaClick(Sender: TObject);
begin
IncrustarForm(PanelFormas, Correspondencia.Create(Self));
end;
procedure TFormPrincipal.IncrustarForm(AParent:TControl; AForm:TCustomForm);
begin
while AForm.ChildrenCount>0 do
AForm.Children[0].Parent:=AParent;
end;
Pero me da un error a la hora de correr el procedimiento, me pone error Access Violation.