TCustomRichViewEdit.GetCurrentItemText, GetCurrentItemTextA, GetCurrentItemTextW

<< Click to display table of contents >>

TCustomRichViewEdit.GetCurrentItemText, GetCurrentItemTextA, GetCurrentItemTextW

Returns text for the item at the position of caret.

function GetCurrentItemText: String;

function GetCurrentItemTextA: TRVAnsiString;

function GetCurrentItemTextW: TRVUnicodeString;

(Introduced in version 1.4, 1.7)

For text items, these methods return visible text. For non-text items, they return item name.

GetCurrentItemText is the same as TopLevelEditor.GetItemText(TopLevelEditor.CurItemNo).

GetCurrentItemTextA is the same as TopLevelEditor.GetItemTextA(TopLevelEditor.CurItemNo).

GetCurrentItemTextW is the same as TopLevelEditor.GetItemTextW(TopLevelEditor.CurItemNo).


unicode Unicode notes:

Internally, text is stored as Unicode. GetCurrentItemTextA converts Unicode to ANSI. For a text item, a code page for conversion is calculated basing on the its Charset. If it is equal to DEFAULT_CHARSET, and for non-text items, Style.DefCodePage is used.

GetCurrentItemText returns:

ANSI string, like GetCurrentItemTextA, in Delphi 2007 and older

Unicode (UTF-16) string, like GetCurrentItemTextW, in Delphi 2009 and newer

Unicode (UTF-8) string, in Lazarus


These methods must be called only when the document is formatted.


See also methods:

SetCurrentItemText -A -W.

See also methods of TCustomRichView:

GetItemText -A -W.

See also properties:



See also:

Obtaining RichView items;

Item types;


Unicode in RichView.