Board index » delphi » Transfering data between 2 RichEdits

Transfering data between 2 RichEdits

Quote
Rosage Beauzil wrote in message <01bdf14c$e815e740$14df60cf@default>...
>I would like to know if there is a windows API function to transfert
>selected text between 2 RichEdits with out using the clipboard.

The quickest way I can think of is to select the text you
want from a particular position (use SelStart and SelLength);
move the selection to a string, then insert into the 2nd
control wherever you want it.

Chris W.

 

Re:Transfering data between 2 RichEdits


I would like to know if there is a windows API function to transfert
selected text between 2 RichEdits with out using the clipboard.

rosage

Re:Transfering data between 2 RichEdits


Rosage:

Try:

  RichEdit2.SelAttributes.Assign(RichEdit1.SelAttributes);
  RichEdit2.SelText := RichEdit1.SelText;
--
Regards
Ralph (TeamB)
Herrsching, Germany
(TeamB cannot respond to questions received via email)

Quote
Rosage Beauzil wrote in message <01bdf14c$e815e740$14df60cf@default>...

|I would like to know if there is a windows API function to transfert
|selected text between 2 RichEdits with out using the clipboard.

Re:Transfering data between 2 RichEdits


Quote
In article <01bdf14c$e815e740$14df60cf@default>, Rosage Beauzil wrote:
> I would like to know if there is a windows API function to transfert
> selected text between 2 RichEdits with out using the clipboard.

See CopyRTF.Zip on my website below which encapsulates the process into
a unit, reducing the required code to:

  Uses clCopyRTF;

  CopyRTF(sourceRichEdit,destRichEdit);

(for those that have previously downloaded this file, I have corrected
the bug that restricted the copy to max of 4096 bytes).

 Mike Orriss (m...@3kcc.co.uk)
 http://www.3kcc.co.uk/delphi.htm

Re:Transfering data between 2 RichEdits


In article <6vf4l7$l...@forums.borland.com>, Ralph Friedman (TeamB)
wrote:

Quote
> Try:

>   RichEdit2.SelAttributes.Assign(RichEdit1.SelAttributes);
>   RichEdit2.SelText := RichEdit1.SelText;

That does not copy formatted text 'as is', but just uses one set of
attributes.

 Mike Orriss (m...@3kcc.co.uk)
 http://www.3kcc.co.uk/notetree.htm

Other Threads