Solved

Colouring Text

Posted on 1998-03-18
4
215 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
[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
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

739 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