Jump to content

How To Change The Background Colour Of The TUniHTMLMemo?


Frederick

Recommended Posts

I am trying to change the background colour of a line of text in the Lines property of a TUniHTMLMemo. The following code does not change the background to clBtnface.

<html><body style="background-color:#F0F0F0;">MemoHtmlText</body></html>

The original background is white and I want to change it to clBtnface. What am I missing here?

--
Frederick
(UniGUI Complete - Professional Edition 1.90.0.1573)
 

Link to comment
Share on other sites

30 minutes ago, Frederick said:

The original background is white and I want to change it to clBtnface. What am I missing here?

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with UniHTMLMemo1 do
    JSInterface.JSAddListener('initialize', 'function(editor){'+
      '  const bodyArea = editor.getEditorBody();'+
      //'  bodyArea.style["font-size"] = "20px";'+
      '  doc = Ext.get(editor.getEditorBody());'+
      '  doc.setStyle("background-color", "#F0F0F0");'+
      '}'
    );
end;

 

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...