如何将 a 的格式化内容TRichEdit
放入 Rave 备忘录缓冲区TMemoBuf
?
user645976
问问题
1082 次
1 回答
0
您必须使用组件中的Lines.SaveToStream
函数TRichEdit
来获取格式化文本 (rtf),并使用TMemoBuf.RTFLoadFromStream
函数将 rtf 文本加载到TMemoBuf
.
var
MemoryStream: TMemoryStream;
begin
MemoryStream:= TMemoryStream.Create;
try
//get the rtf data from the RichEdit into from the Memory stream
RichEdit1.Lines.SaveToStream(MemoryStream);
MemoryStream.Position := 0;
//load the rtf data into the TMemoBuf
MemoBuf1.RTFLoadFromStream(MemoryStream,0);
finally
MemoryStream.Free;
end;
end;
于 2011-07-17T01:28:21.663 回答