Search code examples
delphihandlefiremonkey

Handle Needed For Firemonkey


How can i set the handle needed property for a form in firemonkey. In normal delphi I use to create forms inside other components at run time. IE:

Form1 := TForm1.Create(Panel1);
Form1.Parent := Panel1;
Form1.HandleNeeded;

But now in Firemonkey there are no Handles per say. So is there another way i can do this. It is pretty essential that it has the parent Panel1 as the form has to only show in panel1 and no where else on the screen


Solution

  • In FMX if you want one form to be displayed inside another:

    On the child form, add any controls inside a container (e.g. a TLayout). Create the child form. Set the Parent property of the TLayout (etc.) to the parent form (or, more probably a container on the parent form so you can set the child TLayout's alignment to alClient).