wSelection Property (Edit Controls)

Applies to TestComplete 14.30, last modified on November 21, 2019

Description

Use the wSelection property to obtain the text, which is currently selected in the edit control. To get the starting and ending character positions of the selected text, use the wSelectionStart and wSelectionEnd properties, respectively.

To obtain the entire text displayed in the edit control, use the wText property.

To select text in the edit control, use the Keys action to simulate the appropriate text selection shortcuts. For more information, see Selecting Text Within an Edit Control.

Declaration

TestObj.wSelection

Read-Only Property String
TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section

Applies To

The property is applied to the following objects:

View Mode

This property is available in the Object Browser panel and in other panels and dialogs in both Basic and Advanced view modes.

Property Value

The text selected in the edit control. If no text is selected, the property returns an empty string.

Remarks

Note concerning Telerik RadControls for WinForms 2011.1: Due to incorrect functioning of the Telerik MaskedEditBox control, the wSelection property of the TelerikMaskedEditBox object may return an incorrect value.

Example

To view an example that demonstrates how to use the wSelection property, see Getting the Selected Text in an Edit Control.

See Also

wSelectionStart Property (Edit Controls)
wSelectionEnd Property (Edit Controls)
wText Property (Edit Controls)

Highlight search results