TCustomRichView.GetSelText, GetSelTextA, GetSelTextW

<< Click to display table of contents >>

TCustomRichView.GetSelText, GetSelTextA, GetSelTextW

These methods return the selected part of the document as a text.

function GetSelText: String;

function GetSelTextA: TRVAnsiString;

function GetSelTextW: TRVUnicodeString;

If there is nothing selected, these methods return '' (empty string)

unicode Unicode notes:

Internally, text is stored as Unicode. GetSelTextA converts Unicode to ANSI using Style.DefCodePage code page.

GetSelText returns:

ANSI string, like GetSelTextA, in Delphi 2007 and older

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

Unicode (UTF-8) string, in Lazarus

 

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

 

See also:

Working with selection.