Haven't done this in a while, but IIRC it's:

    rePhraseSentence.lines.Assign(reSentence.lines);

If that doesn't work, then try this:

    mem := tMemoryStream.create;
    reSentence.SaveToStream (mem);
    mem.seek (0,0);
    rePhraseSentence.LoadFromStream (mem);
    mem.destroy;

Of course, both richedits should have PlainText := false;


At 04:37 PM 3/16/2007, you wrote:
>Hi All,
>
>I have two TRichEdits - reSentence and rePhraseSentence.
>The program spends a lot of time figuring out how to highlight
>reSentence with different fonts to help the user identify which
>words have which significance.
>
>Next, I want to copy the contents of reSentence to rePhraseSentence
>intact, with all the same highlight fonts in all the same places so
>the program doesn't have to spend a lot of time doing the
>exact same highlighting to rePhraseSentence that it already
>did to reSentence.
>
>I tried:
>reSentence.CopyToclipboard;
>rePhraseSentence.PasteFromClipboard;
>
>but that didn't do it.
>
>So I tried:
>rePhraseSentence.Lines := reSentence.Lines;
>and
>rePhraseSentence.Text := reSentence.Text;
>
>but of course that didn't do it either - the highlighted font
>information didn't get copied from reSentence to rePhraseSentence.
>
>I tried:
>rePhraseSentence.Assign(reSentence);
>
>but that caused a runtime exception stating that I can't assign
>a TRichEdit to a TRichEdit.
>
>Since rePhraseSentence is placed on panel rePhraseLeft, I tried:
>paPhrasesLeft.rePhraseSentence := reSentence;
>
>but that generated a compiler error.
>
>Can anyone figure out how to move the contents of one RichEdit
>to another RichEdit while preserving the highlighted font selections
>as well as the text?
>
>Help appreciated,
>Rich
>
>
>_______________________________________________
>Delphi mailing list -> [email protected]
>http://www.elists.org/mailman/listinfo/delphi

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to