Page Color

General TRichView support forum. Please post your questions here
Post Reply
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Only by custom drawing events
(for RVPrint - OnPagePrepaint)
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

This code paints even pages in yellow:

Code: Select all

procedure TForm3.RVPrint1PagePrepaint(Sender: TRVPrint; PageNo: Integer;
  Canvas: TCanvas; Preview: Boolean; PageRect, PrintAreaRect: TRect);
begin
  if PageNo mod 2 = 0 then begin
    Canvas.Brush.Style := bsSolid;
    Canvas.Brush.Color := clYellow;
    Canvas.FillRect(PrintAreaRect); // or PageRect to color the full page
    Canvas.Brush.Style := bsClear;
  end;
end;
Odd pages are painted in RichViewEdit.Color.
Post Reply