PWA and Theme for the creating form at runtime

Hi,
I have set in project option --> TMS WEB --> Comple --> Use Operating System Theme --> True and I have set dark theme for Windows.

When I run the app the first form which is created automatically is in the dark theme ... it is ok ... but when I create the second form the background is set to white.

In the code the form is created like below:

begin
Form2 := TForm2.Create(Self);
try
Form2.Popup := False;
await(TForm2, Form2.Load());
await(TModalResult, Form2.Execute);

finally
Form2.Free;
end;

end;

What's wrong?

The repro project is attached.
PWATheme.zip (1.6 MB)

Try to add:

Form2.SetColorScheme(Application.ColorScheme);

Doesn't work, still white.

image

@brunofierens any idea / fix how to solve this?

I did not have time over the weekend. It is on the todolist.

Ok ... thank you ... will waiting.

We applied a fix for this. Next update will address this.

Workaround for now:

 Form2 := TForm2.Create(Self);
  try
  Form2.Popup := False;
  Form2.SetColorScheme(Application.ColorScheme);
  Form2.Color := $202124;
  await(TForm2, Form2.Load());
  await(TModalResult, Form2.Execute);

end;
1 Like

Ok thx ... workaround is working.

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