wItem Property (ListView Controls)

Applies to TestComplete 15.47, last modified on January 20, 2023

Description

Items of the list-view can have subitems. The wItem property allows you to get the caption of the specified item or one of its subitems.

Declaration

TestObj.wItem(Item, SubItem)

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
Item [in]    Required    Variant    
SubItem [in]    Optional    Variant Default value: 0   

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.

Parameters

The property has the following parameters:

Item

Specifies the desired item. You can enter the item’s index (from 0) or its caption. The caption can contain asterisk (*) or question mark (?) wildcards or regular expressions. The asterisk (*) corresponds to a string of any length (including an empty string), the question mark corresponds to any single character (including none). To specify more complicated parts of a caption, use regular expressions.

The caption can be case-sensitive or case-insensitive depending on the value of the Use case-sensitive parameters project setting.

SubItem

The index of the desired subitem or its mask (for more information using masks, see Remarks). Subitems are indexed from 1: the first subitem has the index of 1, the second subitem - 2, and so on. The last subitem’s index is wColumnCount-1.

To get the caption of a list view item, not a subitem, leave the SubItem value default.

Property Value

The caption of the specified item or subitem.

Remarks

The Item and SubItem parameter values can contain regular expressions or wildcards -- * and ?. The asterisk (*) corresponds to the string of any length, the question mark (?) - to any single character. You can use regular expressions and wildcards to indicate variable parts of item and subitem captions. For example, you could use them to get the full caption of a subitem specified by its mask.

If you use Python or DelphiScript, you should enclose the parameters of the wItem property in square brackets: wItem[Item, SubItem].

Example

To view an example that demonstrates how to use the wItem property, see Checking List View Items' State in Desktop Windows Applications.

See Also

wItem Property (Specific to WPFListView and JFXListView Controls)
wItemCount Property (ListView Controls)
wSelectedItems Property

Highlight search results