Solved

TMemo text color (syntax highlighting)

Posted on 1999-01-15
3
342 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

623 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