Solved

Colouring Text

Posted on 1998-03-18
4
214 Views
Last Modified: 2010-04-06
Hi,
    I'm writing an editing program, and need to insert some statements into the memo in colour. The thing is, I want the file to be saved as a simple text file and just to have the colour appearing at run time. Is this possible?
Cheers
0
Comment
Question by:PiersBull
  • 2
4 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 1360596
Hi PiersBull,

What about this? Display the text in a TRichEdit. If you want to save it, save it as a TMemo?

Regards, Zif.
0
 

Author Comment

by:PiersBull
ID: 1360597
Tom,
    Hi, it's me again. (Mr. LaTeX!, under a different user name). Does a TRichEdit give the same functionality as a TMemo? Will it give me any hassle with the program as it is?
Cheers, Nik
 
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1360598
Hi Mr. LaTex!

To tell you the truth, I never use a TRichEdit, for what I now is that they are the same, except in TRichEdit you can give the characters some other look. I mean, some bold, soem italic, some coloured...
But maybe you can find out more in the properties of these two.
Regards,Tom.
0
 

Accepted Solution

by:
wy2lam earned 10 total points
ID: 1360599
You can use TRichEdit to save as plain text of couse, since it "inherits" everything from TMemo (if you want to know why I quoted "inherits", take a look at the help file :-)

However, they are not the same.  First of all, all your users must have the correct version of richedit32.dll (with possible typo, but there should be a file similar with this name) in order to use your RichEdit-enabled application.  Plus, your app will take more resource than if you just use TMemo.

However, Richedit primarily have the advantages of
1. unlimited text length and
2. customizable font

So a solution is to use 3rd-party controls, derive your own, call API to change text attributes with TMemo, or just use a TControlCanvas.

Happy Experimenting !  Michael
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

679 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