Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8727275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:24:25+00:00 2026-06-13T08:24:25+00:00

I used the trick described in this question to display a FireMonkey form on

  • 0

I used the trick described in this question to display a FireMonkey form on a TPanel in a VCL application. My problem is that clicking (controls on) the embedded form causes the VCL form (containing that TPanel) to become deactivated. The most obvious consequence of that is the window border changing color all the time.

When displaying a VCL form on a TPanel of another, this doesn’t happen; the forms apparently “merge”. What should I do to reach a similar result with FireMonkey? I want controls on the FireMonkey form to be usable, but keep the parent form activated.

Update 1

VCL

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  System.Classes, Vcl.Graphics, Vcl.Controls, FMX.Forms, Vcl.Forms,
  Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, FMX.Platform.Win;

type
  TMainForm = class(TForm)
    Panel1: TPanel;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MainForm: TMainForm;

implementation

{$R *.dfm}

uses FireMonkeyForms;

procedure TMainForm.Button1Click(Sender: TObject);
var
  LFMForm: FireMonkeyForms.TForm1;
  LFMHWnd: HWND;
begin
  LFMForm := FireMonkeyForms.TForm1.Create(nil);
  LFMForm.Left := 0;
  LFMForm.Top := 0;
  LFMForm.Height := Panel1.ClientHeight;
  LFMForm.Width := Panel1.ClientWidth;
  LFMForm.BorderStyle := TFmxFormBorderStyle.bsNone;
  LFMForm.BorderIcons := [];
  LFMHWnd := FmxHandleToHWND(LFMForm.Handle);
  SetWindowLong(LFMHWnd, GWL_STYLE, GetWindowLong(LFMHwnd, GWL_STYLE) or WS_CHILD);
  Winapi.Windows.SetParent(LFMHWnd, Panel1.Handle);
  LFMForm.Visible := True;
end;

end.

FireMonkey

unit FireMonkeyForms;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.Layouts, FMX.Memo;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Memo1: TMemo;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.fmx}

end.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:24:26+00:00Added an answer on June 13, 2026 at 8:24 am

    The cause of the behavior is that the window manager does not know you have made your firemonkey window a child, hence it is deactivating the previously active window when you activate the firemonkey window. As is documented in SetParent function you have to set the child flag manually. An example usage could be:

    var
      FMForm: TFMForm1;
      FMHWnd: HWND;
    begin
      FMForm := TFMForm1.Create(nil);
      FMForm.Left := 0;
      FMForm.Top := 0;
    
      FMHWnd := FmxHandleToHWND(FMForm.Handle);
      SetWindowLong(FMHWnd, GWL_STYLE, GetWindowLong(FMHwnd, GWL_STYLE) or WS_CHILD);
      winapi.windows.SetParent(FMHWnd, Panel1.Handle);
      FMForm.Visible := True;
    

    Update:
    If you have to remove the fmx form’s borders, setting BorderStyle sets the WS_POPUP style which you cannot use with WS_CHILD. In that case set the styles you need explicitly instead of getting and ‘or’ring them. F.i.

      ..
      LFMForm.BorderIcons := [];
      LFMForm.BorderStyle := TFmxFormBorderStyle.bsNone;
      LFMHWnd := FmxHandleToHWND(LFMForm.Handle);
      SetWindowLong(LFMHWnd, GWL_STYLE, WS_CHILDWINDOW or WS_BORDER);
      ..
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

One trick I have found very handy in rails application programming is that class_eval
Cocoa used to work on CS3 with the trick of putting a Cocoa bundle
I used chr(252) for tick mark in crystal report, this tick mark displayed in
I'm missing a trick here I think and can't believe I've never done this
I have a django application and until now I used sqLite as database backend.
Please help! I am new to the .NET web application development. I have used
Thanks for reading and for your thoughts; this is a hairy problem, so I
There is a common problem that F# does not natively support infix-style use of
Is there any trick or utility that can take an XML file and turn
I read that a tar entry type of 'L' (76) is used by gnu

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.