|
TCustomRichView.GetOffsAfterItem |
Top Previous Next |
|
Returns offset after the ItemNo-th item in the document function GetOffsAfterItem(ItemNo: Integer): Integer; This method is useful for selecting part of document for copying in the Clipboard, or for moving caret to the specified position in editor. ItemNo – index of the item. Items are indexed from 0 to ItemCount-1, GetItemStyle returns type of item. Items of subdocuments (table cells) are not included in the items range of the main document; for items in cells, use Cell.GetRVData.GetOffsAfterItem. For text items, the method returns length of text + 1 For non-text items, it returns 1.
Example for TRichViewEdit: moving caret to the end of document var ItemNo, Offs: Integer;
ItemNo := MyRichViewEdit.ItemCount-1; Offs := MyRichViewEdit.GetOffsAfterItem(ItemNo); MyRichViewEdit.SetSelectionBounds(ItemNo, Offs, ItemNo, Offs); MyRichViewEdit.Invalidate;
See also methods of TRichView: See also properties of TRichView: See also properties of TRichViewEdit: See also: |