trichview.com

trichview.support




Re: Freeze TRichView document width


Return to index


Author

Message

Sergey Tkachenko

Posted: 10/31/2003 15:49:51


In OnPaint:


procedure TForm1.rvePaint(Sender: TCustomRichView; Canvas: TCanvas;

  Prepaint: Boolean);

var x: Integer;

begin

  Canvas.Pen.Style := psDot;

  Canvas.Pen.Width := 1;

  Canvas.Pen.Color := clBtnShadow;


  x := Sender.LeftMargin-Sender.HScrollPos;


  Canvas.MoveTo(x, 0);

  Canvas.LineTo(x, Sender.Height);


  inc(x, Sender.MaxTextWidth);


  Canvas.MoveTo(x, 0);

  Canvas.LineTo(x, Sender.Height);


  Canvas.Pen.Color := clRed;

  Canvas.Pen.Style := psSolid;

  inc(x, Sender.RightMargin);


  Canvas.MoveTo(x, 0);

  Canvas.LineTo(x, Sender.Height);

end;


This example draws 3 lines. Dotted gray lines show area between margins,

dark red line shows printable area.





Powered by ABC Amber Outlook Express Converter