SelLength Property

Object List Next Object

Defined By:
ComboBox

Description:

Sets or returns the number of characters selected in the text box portion of the designated ComboBox control. Used with SelStart and SelText to perform operations on the selected text.

Settings:

The valid range of settings is 0 to the length of the text, or total number of characters, in the box.

Details:

Use SelLength in conjunction with SelStart and SelText to do things such as determine the insertion point or an insertion range, select substrings in a control, or clear text.

You can set this property in code if the text box has focus. Setting the SelLength value in this manner causes the specified number of characters to be selected in the text box. The selection will begin at the location set by SelStart. Setting SelLength to a value less than 0 causes a program exception to be thrown.

Keep in mind that SelLength is automatically set to 0 when changes are made to SelStart or SelText.

See Also:

SelStart property, SelText property, Text property