make RichView(Edit) transparent?

General TRichView support forum. Please post your questions here
Post Reply
Sega-Zero
Posts: 19
Joined: Thu Nov 22, 2007 9:11 pm

make RichView(Edit) transparent?

Post by Sega-Zero »

Are there any simple way to make them transparent? I mean, to make their background to be painted as it were transparent - copy parent content under the control.
I've found only 1 way to do that - I set OnDrawTextBack, OnDrawCheckpoint, OnDrawPageBreak and OnDrawParaBack events and write that code:

Code: Select all

procedure TForm1.RVStyle1DrawParaBack(Sender: TRVStyle; Canvas: TCanvas; ParaNo: Integer;
  ARect: TRect; var DoDefault: Boolean);
begin
  DrawThemeParentBackground(RichViewEdit1.Handle, Canvas.Handle, nil);
end;
But that trick helps only with a simple edit-like richviews... if they have tables or graphics or child controls, that doesn't work correctly.
if there are no other way, then how can i make tables, cells and craphics transparent?
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You can draw background on bitmap and assign it to BackgroundBitmap property.
Post Reply