New problem on the app I am doing for a local insurance Agency.
Its's a Phone Script (pre-determine words) that they read to customers on the phone.
One of the features they want is to be able to do is Zoom In/Out (enlarge/shrink) the text size in the main viewing window.
Remember, the text is RTF formatted.
If I zoom in/out just using basic (txtRTf.Font.Size:=tztRTf.Font.Size+4) code to enlarge the actual controls font... I LOSE ALL bold/italics of the RTF. I tried "txtRTF.SelectAll" text then change font size, but it still wipes out RTF formatting.
Here is my code (the zoom out code is left out because it is redundant)....
BUTTON ZOOM IN (Enlarge)
procedure TForm5.btnZInClick(Sender: TObject);
var
i: Integer;
fp : TFontParams;
str: String;
begin
i:=txtRTF.font.Size;
if i <=33 Then
begin
txtRTF.SelectAll;
i:=i+4;
if (fsBold in fp.Style) then
txtRTF.SetRangeParams (txtRTF.SelStart, txtRTF.SelLength,[tmm_Styles, tmm_Color],
''{font},i{fontsize},clBlack{color},[fsBold]{make bold/italic},[]{remove bold/italic});
if (fsItalic in fp.Style) then
txtRTF.SetRangeParams (txtRTF.SelStart, txtRTF.SelLength,[tmm_Styles, tmm_Color],
''{font},i{fontsize},clBlack{color},[fsItalic]{make bold/italic},[]{remove bold/italic});
txtRTF.SelStart:=0;
end;
I am sure it has to do with the 2nd block of code (fsBold in fp.style).
But, when I use this code it doesn't enlarge either; and it doesn't work with the Bold/italic... nothing happens, not even enlarging.
How, do I enlarge/shrink RTF text size maintaining RTF Formatting (MS Word Does it.)?