Insert a Form inside a a TmsFMXPagecontrol

Hi, I'm trying to put a Form inside a Tab in my TmsFmxPagecontrol, in a Firemonkey Application.
the tab item is created but the form always shows in a new Window and not inside the tab item.

I try this approach:

var
page : TTMSFMXPageControlPage;
Container : TTMSFMXPageControlContainer;
VForm : Tform ;

begin

Page := Maintab.Pages.Add;
Container := Page.Container;

//New Form
vForm := TForm.Create(Container);
vForm.Parent := Container;
vForm.Show;

Page.Text:= vForm.Caption;

// Active Page in PageControl
MainTab.ActivePageIndex := MainTab.Pages.Count - 1;

Is there a way to solve this problem or a better way to achieve what I need?

Best Regards
Jose

Anyone Please... :frowning:

Hi, sorry for the delayed response, I have been out of office. It's unclear if this is actually related to the TTMSFMXPageControl. Can you try this on a default page control? If the problem persists, try using the Visible property instead of the Show. or change the border style of the form. Alternatively, you can wrap all controls in a Panel, and simply transfer the panel to the container.

Thanks Pieter I will try it

Pieter it works using the wrap method of a panel or layout.

Thanks for pointing me to the solution.

Regards

Jose

1 Like