<< Click to display table of contents >> How to move the caret to the beginning or to the end of document in TRichViewEdit |
Moving to the beginning:
MyRichViewEdit.MoveCaret(rvcmTop);
Moving to the end:
MyRichViewEdit.MoveCaret(rvcmBottom);
The caret is always at the end of selection.
Selection can be changed using method TRichViewEdit.SetSelectionBounds.
Moving to the beginning:
var
ItemNo, Offs: Integer;
...
ItemNo := 0;
Offs := MyRichViewEdit.GetOffsBeforeItem(ItemNo);
MyRichViewEdit.SetSelectionBounds(ItemNo,Offs,ItemNo,Offs);
Moving to the end:
var
ItemNo, Offs: Integer;
...
ItemNo := MyRichViewEdit.ItemCount-1;
Offs := MyRichViewEdit.GetOffsAfterItem(ItemNo);
MyRichViewEdit.SetSelectionBounds(ItemNo,Offs,ItemNo,Offs);
See also:
▪TRichViewEdit.CurItemNo and OffsetInCurItem;