richedit如何编辑大于64K文件?(50分)

  • 主题发起人 主题发起人 Luckm
  • 开始时间 开始时间
L

Luckm

Unregistered / Unconfirmed
GUEST, unregistred user!
在许多书籍中都称Richedit可以编辑大于64K的文件,
它确实也能打开一个大于64K的文件,
但你有没有试过在Richedit中复制文本?
我试了很多次,
复制成的文本无法超过64K!
也就是说在一个Richedit中不断复制文本,
当达到64K时你将无法继续复制,甚至无法用键盘输入单个字母!
那么,如何才能让它没有这个限制呢?
(别告诉我在打开一个超过64K的文件后再复制)
 
操作系统的限制,没办法.
 
RichEdit可以处理2G的数据!缺省情况下RichEdit的MaxLength等于0,
这时就会有64K的限制,你可以将MaxLength改为一个较大的值:

procedure TForm1.FormCreate(Sender: TObject);
begin
RichEdit1.MaxLength := High(Integer) - 1024;
end;
 
to liuly:
好象不是吧?

property MaxLength: Integer;

Description

Use MaxLength to limit the number of characters that can be entered
into the edit control. A value of 0 indicates that there is no
application-defined limit on the length.

Use MaxLength to limit the length of the text in an edit control if
that text will be copied into a fixed-length buffer.

Note:
Setting MaxLength will not truncate the existing text, it merely
prevents the user from adding more text after reaching the limit of
MaxLength characters.

Note:
Even when MaxLength is 0, there may be limitations imposed by the
operating system on the number of characters that may be entered into
an edit control.
 
你试一下吧!
 
to liuly:
确实如此,谢谢!
 
接受答案了.
 
后退
顶部