We help IT Professionals succeed at work.

How to change particular font color in TMemo

tankergoblin
tankergoblin asked
on
Medium Priority
2,044 Views
Last Modified: 2013-11-23
How to change particular font color in Tmemo

example
i have below text in memo

It is important that...

i want to change the color of "important" to green.
is it possible?
Comment
Watch Question

CERTIFIED EXPERT

Commented:
TMemo will not work for that. It's all one font.
You will need to use a TRichEdit In order to have varying fonts.
CERTIFIED EXPERT

Commented:
Here is a pretty good example of changing a font in TRichEdit
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_20294635.html

Author

Commented:
what is the difference btw richedit and memo??
TMemo component shows only simple text (one formating for all text), TRichEdit component shows Rich Text Format (*.rtf files) so text can be simply formated like bold, underline, italic, enumerations etc. Of course each parts of text can be formated seperately.
TRichEdit allows you to apply only simply formating but it is depended on COM objects installed in the operating system so if you have never librarys (newer windows or MS Word installed on) then TRichText can show even tables.


Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.