Solved

TMemo text color (syntax highlighting)

Posted on 1999-01-15
3
336 Views
Last Modified: 2013-12-03
how do I highlight certain text with a TMemo component ? an example would be syntax highlighting within an editor. I would like to highlight multiple parts of the text, in different colors.
0
Comment
Question by:graham_k
3 Comments
 
LVL 10

Expert Comment

by:Lischke
ID: 1418818
Hi Graham,

TMemo isn't designed to be used with different colors and fonts. What you'd need is a rich edit control, where you select a part of the text and then assign your font properties to TRichEdit.SelAttributes (inluding text color).

Ciao, Mike
0
 
LVL 7

Accepted Solution

by:
BlackMan earned 100 total points
ID: 1418819
There is a free edit component (like TMemo) with syntax highlightning here: http://www.eccentrica.org/gabr/mw/mwedit.htm
0
 
LVL 6

Author Comment

by:graham_k
ID: 1418820
Thanks, I'll D/L it & check it out. If for some reason I can't use it, I guess that I'll have to cehck out TRichEdit
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question