Frederick Posted October 5, 2023 Share Posted October 5, 2023 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) Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 5, 2023 Share Posted October 5, 2023 Hello, I will check. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 5, 2023 Share Posted October 5, 2023 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; Quote Link to comment Share on other sites More sharing options...
Frederick Posted October 5, 2023 Author Share Posted October 5, 2023 Thanks. This works. I did see the above post but could not figure how to use it to change the background. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.