Unit 'StdCtrls' Package
[Overview][Constants][Types][Classes][Procedures and functions][Index] [#lcl]

TCustomEdit.SelText

The currently selected text in the edit box for the control.

Declaration

Source position: stdctrls.pp line 875

public property TCustomEdit.SelText : string
  read GetSelText
  write SetSelText;

Description

SelText is a String property which contains the current text selection in the control. The current text selection is the UTF-8-encoded characters in Text identified by the SelStart and SelLength properties.

The property value is derived by calling the UTF8Copy routine in lazutf8.pas. Setting a new value for the property causes the text selection in Text to be replaced with the specified value. The widgetset class is notified when a handle has been allocated for the control.

Values must assigned to the SelStart and SelLength property before accessing SelText.

SelText is updated when the ClearSelection is called to remove the text selection value from the content in Text. SelText is compared to Text to determine the value for AutoSelected when VK_RETURN key or MouseUp messages are handled.

See also

TCustomEdit.SelLength

  

The number of currently selected UTF-8-encoded characters in the control.

TCustomEdit.SelStart

  

The zero-based index for the first UTF-8 character in the current text selection.

TCustomEdit.Text

  

The text displayed and edited for the control.

TCustomEdit.AutoSelected

  

Set to True when the text selection was made automatically.

TCustomEdit.ClearSelection

  

Clears the current text selection in the edit control.

UTF8Copy



CT Web help

CodeTyphon Studio