SelStart Property

Object List Next Object

Defined By:
TextBox

Description:

Indicates the starting point of text selected in the text box. If no text is selected, it indicates the position of the insertion point within the box. Used with SelLength 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:

The value of SelStart is zero-based, which means that the first character position is one greater than the SelStart value. For example, if SelStart is 2 and SelLength is 4, the third, fourth, fifth, and sixth characters in the text are selected.

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.

If SelStart is set to a value greater than the length of existing text, it is automatically reset to the existing text length. Also note that changing the SelStart value reduces the selection to an insertion point and automatically sets SelLength to 0.

Data Type: Long

See Also: