Move caret to end text cell

General TRichView support forum. Please post your questions here
Post Reply
mohonko
Posts: 13
Joined: Fri Mar 23, 2018 9:17 am

Move caret to end text cell

Post by mohonko »

Hello! How to move a caret to the end of text in a table cell?
Sergey Tkachenko
Site Admin
Posts: 17522
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Move caret to end text cell

Post by Sergey Tkachenko »

Moving to the end of table.Cells[r,c]:

Code: Select all

uses RVTable, CRVFData;

var
  RVData: TCustomRVFFormattedData;
  ItemNo, Offs: Integer;

RVData := table.Cells[r,c].Edit as TCustomRVFFormattedData;
ItemNo := RVData.ItemCount - 1;
Offs := RVData.GetOffsAfterItem(ItemNo);
RVData.SetSelectionBounds(ItemNo, Offs, ItemNo, Offs);
mohonko
Posts: 13
Joined: Fri Mar 23, 2018 9:17 am

Re: Move caret to end text cell

Post by mohonko »

I am used CRVFData and RVTable, but is my compiler show message "Undeclared identifier". What is it? In uses main unit i'am wrtite it is modules. The procedure that moves the caret is also in the main module. My version RichViewEdit 16.5.
mohonko
Posts: 13
Joined: Fri Mar 23, 2018 9:17 am

Re: Move caret to end text cell

Post by mohonko »

You have a typing error, as it turned out. It is necessary to write not "TCustomRVFFormattedData" and "TCustomRVFormattedData". Thank you, you helped me a lot.
Post Reply