开发者

more memory for TMemo / TRichEdit

Is there any 开发者_如何学Pythonway to assign more memory for a Memo or RichEdit (if working with big files)

thanks


Allocate memory with LocalAlloc and then give it to the edit control with the em_SetHandle message. You can handle the en_ErrSpace notification if the edit control requires more space. MSDN describes the process in the "About Edit Controls" article. It doesn't work on rich-edit controls, though; they don't store their data in a contiguous buffer like edit controls do.


Rather than load the whole file, wouldn't it be better to use the control as a 'window' to the data? Just load your data in chunks, loading more (and getting rid of some) as the user scrolls up or down.


I would recommend switching to another edit control like SynEdit(it can load 80 mb of text file in few miliseconds).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜