Page 1 of 1
richedit background color in preview

Posted:
May 14th, 2006, 12:16 am
by martincg
How can I get Preview to use the background colour of a richedit?

Posted:
May 15th, 2006, 1:46 pm
by Kambiz
Instead of using Delphi's RichEdit control, use another RichEdit control like those one in RxLibrary.

Posted:
May 16th, 2006, 10:41 am
by martincg
If I set the colour of a TRichEdit then this does not appear in the preview.
Do you mean that if I use a TJVRichEdit say, and set the colour then this colour will be used as the background in the preview?

Posted:
May 16th, 2006, 12:05 pm
by Kambiz
I thought you were talking about the background color of the text.
To fill the background of the page with the background of the control, use OnNewPage event and fill the page with the control's color yourself.

Posted:
May 16th, 2006, 12:37 pm
by martincg
I don't want the whole page to be one colour.
I have a number of richedits and one or more could have a different background colour. So when I call PaintRichText I would like to be able to set the background colour just for the painted area of the richedit.
I tried painting the rectangle with a colour first but that was removed by PaintRichText.
If PaintRichText uses the paper colour then how do I have different background colours for different richedits?

Posted:
May 16th, 2006, 1:52 pm
by Kambiz
In this case, you have to set the background color of the text.