Auto Scale a Memo
hi,
is there a way to make a fixed sized memo scale its font size to show its whole contents? tried it with setting th font size per script an checking the height but had near to no success (:
any help is appreciated
cheers
Chris
is there a way to make a fixed sized memo scale its font size to show its whole contents? tried it with setting th font size per script an checking the height but had near to no success (:
procedure TextOnBeforePrint(Sender: TfrxComponent);
var
 TargetH: Extended;
 CurrentH: Extended;
 FontSize: Integer;
begin
 TargetH := 5.90;
 FontSize := 30;
 Text.Font.Size := FontSize;
 CurrentH := Text.CalcHeight() / fr1cm;
 while ((CurrentH > TargetH) and (Text.Font.Size > 8)) do
 begin
  FontSize := FontSize - 1;
  Text.Font.Size := FontSize;
  CurrentH := Text.CalcHeight() * fr1cm;
 end;
end;
any help is appreciated
cheers
Chris