FMX.Memo.TCustomMemo.CaretPosition

From RAD Studio API Documentation
Jump to: navigation, search

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 TCustomMemo

Description

Provides access to the current cursor position in the memo's text.

Use CaretPosition to determine the coordinates of the cursor (insertion point) in the memo control. The TCaretPosition type has 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 at the fourth line and at the sixth character from the start of the line.

See Also