wItemState Property (Specific to CheckedListBox and CheckListBox Controls)

Applies to TestComplete 15.69, last modified on November 13, 2024

Description

Each item of a check list box control can be in the checked, unchecked or indeterminate (grayed) state. Use the wItemState property to get or set the state of the specified item.

Declaration

TestObj.wItemState(Item)

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

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.

Parameters

The property has the following parameter:

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.

Property Value

One of the following constants that specify the item’s state:

Value Description
cbUnchecked, False or 0 The item is unchecked.
cbChecked, True or 1 The item is checked.
cbGrayed or 2 The item is switched to grayed (indeterminate state).

Remarks

Note that the items of the check list box may be in the indeterminate (grayed) state only if the list box’s AllowGrayed property is True. Otherwise, the items does not support the indeterminate state. In this case, if you pass cbGrayed to the State parameter, CheckItem will fail and post an error message to the test log.

See Also

CheckItem Action (Specific to DevExpressCheckedListBox and DevExpressCheckListBox Controls)
wItem Property (ListBox Controls)
wItemCount Property (ListBox Controls)
wSelected Property (ListBox Controls)

Highlight search results