3

How can I add formatted text to a SynEdit control? I don't actually need syntax highlighting, I want to be able to control the colors of specific parts of a line.

I am currently using a TRichEdit and setting SelAttributes.Color and SelAttributes.Text in order to achieve this effect. It works fine, but I am hoping to get away from using TRichEdit.

Can I do something similar with SynEdit, or is it not the ideal component for the job?

Aaron
  • 189
  • 6
  • Maybe you should consider embedding a webbrowser instead. That's probably how I would solve it. – Wouter van Nifterick Jul 13 '13 at 08:01
  • SynEdit it's basically a code editor. You can control certain properties but usually through a highlighter. Are you trying to create a log viewer? – Leonardo Herrera Jul 13 '13 at 17:37
  • @Wouter van Nifterick: I have considered giving that a shot. Would it be as fast? – Aaron Jul 13 '13 at 19:54
  • @Leonardo Herrera: I am actually making a MUD client. I receive text via TCP, and it has ANSI escape codes that signify that certain portions of the text need to be displayed in specific colors. I parse the text and display it appropriately on the RichEdit. RichEdit is working fine for now, but I was kicking around the idea of trying to switch to something else, so that my code would be less platform dependent. – Aaron Jul 13 '13 at 19:59
  • 1
    Interesting. There are components that do this, thought (take a look at [this SO answer](http://stackoverflow.com/a/896220/7841), for example.) – Leonardo Herrera Jul 13 '13 at 20:32
  • @Leonardo Herrera What would be your suggestion if this was a log viewer? – Mehmet Fide Jan 20 '22 at 18:26
  • Actually, I'd use a VirtualTree or similar component. – Leonardo Herrera Jan 21 '22 at 12:33

0 Answers0