Solved

Colouring Text

Posted on 1998-03-18
4
208 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now