FMX.Memo.TCustomMemoModel.CaretPosition
Delphi
property CaretPosition: TCaretPosition read GetCaretPosition write SetCaretPosition;
C++
__property Fmx::Text::TCaretPosition CaretPosition = {read=GetCaretPosition, write=SetCaretPosition};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
property | public | FMX.Memo.pas FMX.Memo.hpp |
FMX.Memo | TCustomMemoModel |
Description
Provides access to the current cursor position in the text of the memo.
Use CaretPosition to determine the coordinates of the cursor (insertion point) in the memo control. The TCaretPosition type has the Line
and Pos
integer fields:
Line
represents the number of the line containing the cursor, indexed from zero.Pos
represents the horizontal character coordinate of the cursor, indexed from zero.
Modify the value of the CaretPosition property in order to change the position of the cursor within the memo control. In order for the cursor to be visible, the memo control must have focus.
Thus, if Line = 3
and Pos = 5
, then the cursor is positioned at the fourth line and at the sixth character from the start of the line.