IComboBox.SelLength

Syntax

SelLength: Integer;

Description

The SelLength property determines length of the selected component text in characters.

The selection starts with the SelStart position. The SelText property returns the selected text. This property returns correct values if the component is focused. In all other cases the property returns 0.

Example

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:

IComboBox