Jump to content

change the color of the MainmForm title at runtime


Ario.Paxaz

Recommended Posts

Hello

 

Is it possible to change the color of the title at runtime?

I tried with the following code but it didn't work.

 

procedure TMainmForm.UnimBitBtn1Click(Sender: TObject);
begin
 MainmForm.TitleColor := clRed;
end;

procedure TMainmForm.UnimBitBtn2Click(Sender: TObject);
begin
 MainmForm.TitleColor := clGreen;
end;

 

Regards.

Link to comment
Share on other sites

18 hours ago, Ario.Paxaz said:

Is it possible to change the color of the title at runtime?

Hello,

Try this workaround:

1. Uses list:

... uniGUIJSUtils;

2.

  MainmForm.TitleColor := clGreen;
  JSInterface.JSCode(Self.Name + '.titlebar.setStyle({backgroundColor:"'+uniColor2Web(TitleColor)+'"});'); //<-----------

 

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...