I want to add a line of text to a TextArea. The area already has text in it. I want to color that new specific line blue and not the rest of the Textarea.
How to do that?
I want to add a line of text to a TextArea. The area already has text in it. I want to color that new specific line blue and not the rest of the Textarea.
How to do that?
Check the documentation sample-code: StyledText — Xojo documentation
Of course. Done that. Ran the demo code. But it doesn’t show you to change one single line.
DesktopTextArea.SelectionTextColor = Color.Blue
DesktopTextArea.AddText("The blue line text" + EndOfLine)
DesktopTextArea.SelectionTextColor = Color.Black
That is a bit simplistic. You need style runs and then you add the style run to the styled text.
Did the trick…
No, it works for my purpose
If you are going to work with more than just a few pages of styled text… i would highly recommend to not use the RTF styling in a Xojo TextArea control… way… too… slow. There are multiple alternatives available.
Could you please tell, which they are (not MBS)?
Sharing this with you, we wrote this control for our main application (the control within the green square)