wSelectedItems Property

Applies to TestComplete 14.71, last modified on April 22, 2021

Description

Use the wSelectedItems property to get the captions of currently selected items as one string separated by the value of the wListSeparator property.

Declaration

TestObj.wSelectedItems

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

To view this property in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.

Property Value

A string containing the captions of currently selected items.

Remarks

For Win32 ListBox: If the list box control does not have the LBS_HASSTRINGS style, the wSelectedItems property will return an empty string and TestComplete will post an error message to the test log.
For WPF Controls: If a control uses data binding for its items, the wSelectedItems property may fail to get the captions of the selected items and will return empty strings instead. To get the captions of the selected items, you can use the control’s native properties.

Example

To view an example that demonstrates how to use the wSelectedItems property, see Getting the Selected List View Item(s).

See Also

Getting Several List Box Items

Highlight search results