Hi
I hope your help to copy text from a RichEdit (Delphi IDE) in a RichView (component TRichView).
If possible what is the procedure.
I did like that
RichView1.text := RichEdit1.text ; ---- Error
RichView1.ADDNL := RichEdit1.text ; ----Error
I thank all the help
How RichEdit to RichView
I haven´t tested it yet, but you might try:
Code: Select all
procedure CopyFromRichEditToRichView();
var strStream: TStringStream;
begin
RichEdit1.Lines.SaveToStream(strStream);
RichView1.LoadRTFFRomStream(strStream);
end;
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
More exactly
Make sure that RichEdit.PlainText = False;
Code: Select all
procedure CopyRichEditToRV(RichEdit: TRichEdit; RichView: TCustomRichView);
var Stream: TMemoryStream;
begin
Stream := TMemoryStream.Create;
try
RichEdit.Lines.SaveToStream(Stream);
Stream.Position := 0;
RichView.Clear;
RichView.LoadRTFFromStream(Stream);
RichView.Format;
finally
Stream.Free;
end;
end;
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: