SelStart: Integer;
The SelStart property determines the position to start text selection in the component.
This property returns correct values if the component is focused. In all other cases the property returns 0.
Executing the example requires a form, a button named Button1 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: