R
rruu
Unregistered / Unconfirmed
GUEST, unregistred user!
使用sendMessage函数向richedit添加有格式的数据,当数据量达到64K后,不能再添加任何数据(64K限制),代码如下:
procedure RichAdd(rich:TRichedit;str1:string;str2:string);
const
cRtfFormat =
'{/rtf1/ansi/ansicpg936/deff0/deflang1033/deflangfe2052{/fonttbl{/f0/fnil/fcharset134 Arial;}}'+#13#10+
'{/colortbl ;/red128/green128/blue128;/red0/green0/blue255;}'+#13#10+
'/viewkind4/uc1/pard/cf1/lang2052/f0/fs24' +#13#10+
'{/cf1 %s/cf2 %s/par}';
begin
SendMessage(rich.Handle, EM_REPLACESEL,0,
Longint(PChar(Format(cRtfFormat,[str1, str2]))));
end;
下面操作也不起作用:
SendMessage(RichEdit1.Handle,EM_LIMITTEXT,0, $7FFFFFFF);
谢谢!
procedure RichAdd(rich:TRichedit;str1:string;str2:string);
const
cRtfFormat =
'{/rtf1/ansi/ansicpg936/deff0/deflang1033/deflangfe2052{/fonttbl{/f0/fnil/fcharset134 Arial;}}'+#13#10+
'{/colortbl ;/red128/green128/blue128;/red0/green0/blue255;}'+#13#10+
'/viewkind4/uc1/pard/cf1/lang2052/f0/fs24' +#13#10+
'{/cf1 %s/cf2 %s/par}';
begin
SendMessage(rich.Handle, EM_REPLACESEL,0,
Longint(PChar(Format(cRtfFormat,[str1, str2]))));
end;
下面操作也不起作用:
SendMessage(RichEdit1.Handle,EM_LIMITTEXT,0, $7FFFFFFF);
谢谢!