Unit 'StdCtrls' Package
[Overview][Constants][Types][Classes][Procedures and functions][Index] [#lcl]


The position of the editing cursor in the control.


Source position: stdctrls.pp line 860

public property TCustomEdit.CaretPos : TPoint
  read GetCaretPos
  write SetCaretPos;


CaretPos is a TPoint property which contains the coordinates for the caret (or editing cursor) in the control. The coordinates reflects logical (UTF-8) characters and lines.

Contains the zero-based offset into the UTF-8-encoded characters in the control Text. Position 0 is immediately prior to the first UTF-8 character in Text. If there is selected text in the control, the caret is considered to be positioned right after the last selected character. Character positions are independent of the LTR/RTL BiDi-ness for the control.
Contains the zero-based relative line number for the editing cursor. For single-line edits the value is normally 0.

The value in CaretPos is updated by the widgetset class when key and selection control messages are handled.

CT Web help

CodeTyphon Studio