trichview.com

trichview.support




Re: Deleting an item safely (2)


Return to index


Author

Message

Martin Holmes

Posted: 08/24/2004 15:12:22


Hi Sergey,


This code wouldn't run for me -- the debugger complained that RVData had

no method SetSelectionBounds.


I eventually found that I needed  to cast the RVData like this:


TCustomRVFormattedData(RVData).SetSelectionBounds...


It still doesn't seem to be selecting and deleting the text, though. I'm

still working on it.


Cheers,

Martin


Sergey Tkachenko wrote:

> If this operation must be undone/redone, deletion must be done by selecting

> and calling DeleteSelection.

>

> If you have RVData and ItemNo (index of item inside this RVData), the code

> is:

>

> RVData := RVData.Edit;

> RVData.SetSelectionBounds(ItemNo, RVData.GetOffsBeforeItem(ItemNo),

>   ItemNo, RVData.GetOffsAfterItem(ItemNo));

> RichViewEdit1.DeleteSelection;

>

>





Powered by ABC Amber Outlook Express Converter