Jump to content

TMemo-like Control with Colored Text?

Recommended Posts

I need something like a TMemo (or TW3Memo), but where each line can be assigned a different font color. That is, when you add a line of text, you also specify a color for the text.

I don't need editing. Just a colorful scrolling display, with the ability to select and copy to the clipboard.

Does something like this already exist in SMS?

I'm not against rolling my own. If that's how it has to be, any hints or tips for how I might do that?



Link to post
Share on other sites

Hi David!

The good news is that all the ordinary rules of html apply, everywhere. So you can for example set the text of a line with inline html (see listbox.items.add or listbox.add depending on version):

’<p style=«background-color: #ff0000»>hello red</p>’

The DOM will recognize this and inject it as is, which is both easy and fun.

If you need more elaborate styling you might want to check the SmartCL.%css% units. There is a global stylesheet where you can inject full styles and then use that instead of inline styling.

let me know if you run into difficulty

Link to post
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.

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