trichview.com

trichview.support




Re: copying items


Return to index


Author

Message

Sergey Tkachenko

Posted: 04/30/2002 16:08:59


Even if RichView is invisible, you can select items

(but it must be formatted)


var Stream: TMemoryStream;


Stream := TMemoryStream.Create;

with RichViewEdit do

begin

  // selecting items 3..6

  SetSelectionBound(3, GetOffsBeforeItem(3),

    6, GetOffsAfterItem(6));

  CopyRVFToStream(Stream, True);

  Stream.Position := 0;

  // positioning caret before the 8th item

  SetSelectionBound(8, GetOffsBeforeItem(8),

    8, GetOffsBeforeItem(8));

  InsertRVFFromStreamEd(Stream);

  Stream.Free;

end;


PS: items are numbered from 0


> Is it possible to copy items without selecting them?

>

> For example:

> I got 10 textitems in an invisible RichView and want to duplicate item 3

> to 6 before the 8th Item at runtime.

>

> The problem is, that I can't use the copy and paste functions, because the

> RichView is unvisible and I can't select items. Another problem is to set

> the caret in front of the 8th item.

>

>

> thanks

> Steffen K�thner





Powered by ABC Amber Outlook Express Converter