Selecting Part of TRichView Document
User can select a part TRichView document with the mouse (in TRichViewEdit he/she also can use Shift +caret movement keys).
You can turn off/on a word selection mode, see TRVStyle.SelectionMode.
By default, it is clHighlightText on clHighlight both for active (focused) and inactive windows.
See also RVStyle.SelectionStyle.
▪disallow making selection (clear rvoAllowSelection in Options); please do not use in editor!
▪determine if the selection is not empty (SelectionExists);
▪deselect TRichView (Deselect; Invalidate);
▪select the whole document (SelectAll; Invalidate);
▪get selection bounds (GetSelectionBounds);
▪select a part of the document (SetSelectionBounds;Invalidate);
▪select the inserted control (SelectControl);
▪get the selection as a text (GetSelText, GetSelTextW);
▪get the selection as an image, if image is selected (GetSelectedImage);
▪copy the selection to the Clipboard in various formats (see RichView Clipboard Functions Overview)
In editor you can:
▪delete selection (DeleteSelection);
▪cut selection to the Clipboard (CutDef);
Note: All methods introduced in RichView which can change visual appearance require calling Invalidate or Refresh after them.
Note: All methods working with selection must be called only when the document is formatted.