FMX.Memo.Style.TStyledMemo.CaretPosition
Delphi
property CaretPosition: TCaretPosition read FCaretPosition write SetCaretPosition;
C++
__property Fmx::Text::TCaretPosition CaretPosition = {read=FCaretPosition, write=SetCaretPosition};
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| property | public | FMX.Memo.Style.pas FMX.Memo.Style.hpp |
FMX.Memo.Style | TStyledMemo |
Description
Provides access to the caret position in the TMemo control.
Use CaretPosition to determine the coordinates of the cursor in the TMemo control. The Types.TCaretPosition type has two fields, Line and Pos, both of type Integer.
Line indicates the number of the line containing the cursor, indexed from zero.
Pos indicates 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 TMemo control. In order for the cursor to be visible, the TMemo control must have focus.
Thus, if Line = 3 and Pos = 5, then the cursor is at the fourth line and at the sixth character from the start of the line.