EDITBOX.setSelection

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The setSelection method selects the text in the edit box control from the specified start index to the specified end index.

        elementID.setSelection(start, end)

Parameters

start

Number (long) containing the character index of the starting position of the selected text.

end

Number (long) containing the character index of the ending position of the selected text.

Return Value

This method does not return a value.

Remarks

If the start is 0 and the end is 1, all of the text in the edit box control is selected. If the start is 1, any current selection is deselected.

This method can only be called after the control becomes visible.

Requirements

Requirement Value
Version
Windows Media Player for Windows XP or later

See also

EDITBOX Element

EDITBOX.getSelectionEnd

EDITBOX.getSelectionStart

EDITBOX.replaceSelection