rvico TRichView Reference | TRichView

TCustomRichView.GetSelText, GetSelTextW

Top  Previous  Next

Returns the selected part of the document as a text in ANSI (GetSelText) or Unicode (GetSelTextW) encoding.

function GetSelText: String;

function GetSelTextW: WideString;

If there is nothing selected, this method returns '' (empty string)

unicode Unicode note: the methods are recommended for Unicode applications.

GetSelText 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).

 

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

 

See also:

Working with selection.


RichView © Sergey Tkachenko