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
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)
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;