Solved

RTF - change background color

Posted on 1999-01-08
9
301 Views
Last Modified: 2010-04-06
how do i change the background color of a single line
in RichEdit field ?
if it's not possible - is there any other component which
provides colored text, different background colors
on a single line and the TMemo functions ?

thx
benni
0
Comment
Question by:benni
9 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 1355267
so you want a TMemo which is capable of doing that? You just tried to use richedit for coloring the background? If so, then this component is just for you (it's even freeware. But if you need the source too, you've to pay...) Here, look at this page :

http://www.balticsolutions.com/products/cmemo/index.html

Regards, Zif.
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1355268
This is an extract from the win32.hlp file:

"Foreground color is a character attribute, but background color is a property of the rich edit control."

So as you can read there, a richEdit component can't do it...  :-(

Regards, Madshi.
0
 

Author Comment

by:benni
ID: 1355269
hmm I know this component, but it works only good for keywords

I need a (simple) way to set the bgcolor on a specific position
and all the following typed text should have this bgcolor until
a other bgcolor is set ...

It might be possible to do this with the ColorMemo, but it
seems too much work for me ...

RichEdit1.SelAttributes.Color is realy fine for the textcolor !
is there no such thing like RichEdit1.SelAttributes.BgColor ???


0
 

Expert Comment

by:ptiemann2
ID: 1355270
TRichEdit cannot do it (setting the background color), although RTF does have the \bg command.

Now there is a new RichEdit control, RichEdit2. It can do things that the old one could not do although RTF could do it.. most famous example: display embedded images.

Maybe this new control - you might get it from MS through a DLL update - also handles your background color .. with a SendMessage() ?
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 20

Expert Comment

by:Madshi
ID: 1355271
There are some components for the RichEdit2 here:

http://nswt.tuwien.ac.at/delphi/index.htm

Look for RichEdit98...

But I don't know, if that would solve your problem...

Regards, Madshi.
0
 

Author Comment

by:benni
ID: 1355272
thanks madhsi - RichEdit98 can do what I want

you might send your comment as an answer, so I can give you
your points ...

0
 
LVL 20

Accepted Solution

by:
Madshi earned 100 total points
ID: 1355273
Thank you...  :-)

Regards, Madshi.
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1355274
Hmmm. But you'll have to ship the RichEd20.dll with your product, since it's not included in the standard dll set of win95...
0
 

Author Comment

by:benni
ID: 1355275
that dosnt matter :-) ...
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Intraweb submit form as a POST request 4 229
How can I open IE in olecontainer? 7 109
Convert Jpg /PNG To GIF 5 103
Multiple image collision 13 45
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…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 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

19 Experts available now in Live!

Get 1:1 Help Now