How to use TTMSFNCWebBrowser in two forms

I want to open two forms where I show the dashboard data in the first main form and the second form will be used to handle that data.
now when I try to do that the first form loads perfectly but the second hangs and then just stays blank.

How to use the webbrowser control in two forms? or any other solutions to show to pages in two forms

thanks

My setup:
IDE: Delphi 10.3.3 FMX framework
OS: Win10 64bit.
Control: TTMSFNCWebBrowser.

I cannot reproduce this. Test project attached.

Project1.zip (7.4 KB)

You are right about the scenario you gave,
I'm really sorry for not mentioning that I'm showing the second form from a javascript bridge.
I have attached the project to reproduce.project1.zip (9.2 KB)

if you use the same javascript bridge example in the doc and create the form and try to show it it will get stuck at the creation step waiting for initialization (whenthe Loaded method is executed)

The responsible developer will investigate this and will report on this.

1 Like

Hi,

You can fix the problem by using a Timer to show the form. We'll look into the issue, but this is probably related to threads interfering with eachother.

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Timer1.Enabled := False;
  TForm2.Create(Application.MainForm).Show;
end;

{ TReactBridgeObject }

function TMyBridgeObject.GetObjectMessage: string;
begin
  Result := FObjectMessage;
end;

procedure TMyBridgeObject.SetObjectMessage(const Value: string);
begin
  Form1.Timer1.Enabled := True;
  FObjectMessage := Value;
end;

Thank you very much it is working as intended now.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.