rvico TRichView Reference | TRichView

TCustomRichView.GetSelText, GetSelTextW

Top  Previous  Next

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:

GetSelTextA always returns ANSI string:

If the item is a non-text item, or a text item of ANSI style, the text is returned as it is.

If the item is a Unicode text item, the function converts Unicode text to ANSI (Unicode text is converted basing on Charset of the item text style).

GetSelTextW always returns Unicode string:

If the item is a Unicode text item, the text is returned as it is.

If the item is a non-text item, or a text item of ANSI style, the function converts ANSI text to Unicode (ANSI text is converted basing on Charset of the item text style, or on RVStyle.DefCodePage for non-text items).

GetSelText works like GetSelTextW in Delphi/C++Builder 2009 or newer, and like GetSelTextA in the older versions of Delphi/C++Builder.

 

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

 

See also:

Working with selection.


TRichView © trichview.com