Vielleicht hilft Dir das weiter?
http://www.swissdelphicenter.ch/de/showcode.php?id=1466
in Kurzform habe ich etwas derartigen in meiner Spickerkiste
Delphi-Quellcode:
procedure PaintRichedit(canvas:TCanvas;re:Trichedit;Bounds:Trect;pixelsperinch:Integer=96);
var fmt : TFormatRange;
begin
InflateRect(Bounds,-2,-2);
Bounds.Left := Round(Bounds.Left * 1440 / pixelsperinch) ;
Bounds.right := Round(Bounds.right * 1440 / pixelsperinch) ;
Bounds.top := Round(Bounds.top * 1440 / pixelsperinch);
Bounds.Bottom := Round(Bounds.Bottom * 1440 / pixelsperinch);
with fmt do
begin
hdc:= Canvas.handle;
hdcTarget:= hdc;
chrg.cpMin := 0;
rcPage := Bounds;
rc := Bounds;
chrg.cpMax := re.GetTextLen;
end;
SetBkMode( Canvas.Handle, TRANSPARENT );
re.perform( EM_FORMATRANGE, 1, integer( @fmt ));
re.perform( EM_FORMATRANGE, 0, 0 );
end;