0

如何将 a 的格式化内容TRichEdit放入 Rave 备忘录缓冲区TMemoBuf

4

1 回答 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 回答