1
votes

I am trying to embed a VCL form in an FMX form, where the FMX form contains a TScalingLayout set to alClient so that on form resize the entire content is scaled.

The only way I have found to embed the VCL form in FMX Form in the first place is like so:

  VCLForm.ParentWindow := WindowHandleToPlatform(FMXForm.Handle).Wnd;
  VCLForm.Show;

Unfortunately this leaves me unable to parent the VCLForm to my TScalingLayout directly, so when I resize my FMX form naturally the embedded VCL form does not scale.

I thought that if I can only put the VCL form onto a form directly I could just use another FMX form as a container and embed this container form in my ScalingLayout, but since I can only "embed" an FMX form in another by moving all its children my VCL form won't be moved.

Is there a way to embed my VCL form in a way that will scale its content in the same way all the FMX controls on my ScalingLayout are scaled ?

1
Can you resize the vcl form manually from an OnResize event?David Heffernan
Yes I have tried that and it works fine, the issue is the ScalingLayout scales down all the FMX content (as opposed to e.g. showing scrollbars when the window gets smaller). I would have to do so too with the content on my VCL form in addition to asjusting the size.DNR

1 Answers

1
votes

No it is not possible. The reason Firemonkey can scale its components is because Firemonkey makes and draws them all by itself from scratch.

Most VCL controls are made out of built-in Windows OS components that your program calls. And those don't have any ability to scale. They are not drawn by the VCL, the VCL tells Windows to draw them. So if FMX does not draw them, it cant scale them.