"get.cell.fontsize"

General TRichView support forum. Please post your questions here
Post Reply
j&b
Posts: 184
Joined: Mon Sep 05, 2005 1:35 pm

"get.cell.fontsize"

Post by j&b »

Hello ,

I have a rveTable with "cell.font.size" of 9.

Now I write something in the 2. col:


....

for r := 0 to rveTable.Rows.Count-1 do begin
try
if (rveTable.Cells[r,2]<>nil) and (rveTable.Cells[r,i].GetRVData.GetItemStyle(0)>=0) then begin
rveTable.Cells[r,2].clear;
rveTable.Cells[r,2].AddNL('Paul',0,1); // I think AddNl is wrong
end;
except
break;
end;
end;

finally
if rveTable<>nil then begin
memo.EndItemModify(ItemNo, Data);
memo.Change;
end;
...

end;


After cells are modified the fontsize of the new written text is 12 (and not 9 as before).

I want that program "get.cell.font.size" and write text back (memo.change) in the same font.size.


Who can help me ?

(Sergey ?)
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Code: Select all

var StyleNo, ParaNo: Integer;

if (rveTable.Cells[r,2]<>nil) and 
  (rveTable.Cells[r,2].GetRVData.GetItemStyle(0)>=0) then begin 
  StyleNo := rveTable.Cells[r,2].GetRVData.GetItemStyle(0);
  ParaNo := rveTable.Cells[r,2].GetRVData.GetItemPara(0);
  rveTable.Cells[r,2].Clear; 
  rveTable.Cells[r,2].AddNL('Paul',StyleNo,ParaNo);
end;
// I changed [r,i] to [r,2]
j&b
Posts: 184
Joined: Mon Sep 05, 2005 1:35 pm

Post by j&b »

THANKS, Sergey
Post Reply