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?



Share this post

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

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now