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 » Sat May 05, 2018 5:54 pm

Hello! How to move a caret to the end of text in a table cell?

Sergey Tkachenko
Site Admin
Posts: 14035
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Move caret to end text cell

Post by Sergey Tkachenko » Sat May 05, 2018 7:59 pm

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 » Sat May 05, 2018 8:21 pm

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 » Sat May 05, 2018 8:29 pm

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