richedit background color in preview

Please discuss general Delphi programming topics here.

richedit background color in preview

Postby martincg » May 14th, 2006, 12:16 am

How can I get Preview to use the background colour of a richedit?
martincg
Active Member
Active Member
 
Posts: 10
Joined: April 22nd, 2006, 11:13 am

Postby Kambiz » May 15th, 2006, 1:46 pm

Instead of using Delphi's RichEdit control, use another RichEdit control like those one in RxLibrary.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby martincg » May 16th, 2006, 10:41 am

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?
martincg
Active Member
Active Member
 
Posts: 10
Joined: April 22nd, 2006, 11:13 am

Postby Kambiz » May 16th, 2006, 12:05 pm

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.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby martincg » May 16th, 2006, 12:37 pm

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?
martincg
Active Member
Active Member
 
Posts: 10
Joined: April 22nd, 2006, 11:13 am

Postby Kambiz » May 16th, 2006, 1:52 pm

In this case, you have to set the background color of the text.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 0 guests

cron