TFireMonkeyContainer

TFireMonkeyContainer

Officially, you cannot use both the VCL and FireMonkey together in the same project. Unofficially, however, it can be useful to do so – for example, to use FireMonkey’s 3D features in a VCL form or to ease the process of migrating from VCL to FireMonkey.

A 3D FireMonkey form on a VCL TPageControl. The other tab has a 2D FireMonkey form.
A 3D FireMonkey form on a VCL TPageControl. The other tab has a 2D FireMonkey form.

This unit is a small VCL component you can put on a VCL form, which hosts or embeds a FireMonkey form.  FireMonkey lives completely fine inside the VCL host, rendering and animating perfectly. There are events for creating and destroying the embedded form, allowing you to control the embedded form’s lifetime. It supports all versions of FireMonkey in XE2, XE3, XE4, XE5, XE6 and XE7.

It’s free and licensed under the commercial-use-friendly MPL. Being open-source, and also being a bit of a hack, contributions adding more functionality or fixing any bugs you encounter are gratefully accepted. The code was originally inspired by DSharp.Windows.FMXAdapter.pas by Stefan Glienke, but has been so heavily modified I regard it as a separate work. Thanks must go to Stefan for the idea and original technique.