SelLength: Integer;
The SelLength property defines length of the selected component text in characters.
The selection begins with the SelStart position. The SelText property returns the selected text. This property returns the correct values, if the component has focus. In all other cases the property returns 0.
Executing the example requires a form, a button named Button1 positioned on it and the ComboBox component named ComboBox1.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Begin
ComboBox1.SelStart := 3;
ComboBox1.SelLength := ComboBox1.Text.Length - 3;
ComboBox1.SelText := "New Value";
End Sub Button1OnClick;
After executing the example pressing the button changes a part of the text of the ComboBox1 component for the specified value.
See also: