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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...