Jump to content

How To Change Background Colour And Font Colours/Styles In TCVLStatusPanels Of TUniStatusBar?


Frederick

Recommended Posts

I have two panels in a TUniStatusBar. The background colour of the control can be changed but I would like to control the visual appearance of individual panels.

How do I change the background colour and the font colour and style of the each panel?

--
Frederick
(UniGUI Complete - Professional Edition 1.90.0.1514)
 

statusbar.png

Link to comment
Share on other sites

4 hours ago, Frederick said:

 How do I change the background colour and the font colour and style of the each panel?

One possible solution I think.

procedure TMainForm.UniFormReady(Sender: TObject);
begin
  with UniStatusBar1.JSInterface do
  begin
    //[0] = Panels[0]
    JSCode(#1'.getRefItems()[0].setStyle("font-weight", "bold");');
    JSCode(#1'.getRefItems()[0].setStyle("color", "red");');
    JSCode(#1'.getRefItems()[0].setStyle("background-color", "yellow");');

    //[1] = Panels[1]
    JSCode(#1'.getRefItems()[1].setStyle("font-weight", "bold");');
    JSCode(#1'.getRefItems()[1].setStyle("color", "white");');
    JSCode(#1'.getRefItems()[1].setStyle("background-color", "black");');
  end;

end;

 

  • Like 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...