CheckItem moves the mouse cursor to the specified item in a check list box control and sets its state (checked, unchecked or grayed). To check current state of the specified item, use the
|TestObj||A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section|
The method is applied to the following objects:
This method is available in the Object Browser panel and in other panels and dialogs in both Basic and Advanced view modes.
The method has the following parameters:
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.
Specifies the state of the item. There are three possible states for each of items in a check list box control. To set the state of the specified item, the following constants can be used in the State parameter:
||The item becomes unchecked.|
||The item becomes checked.|
||The item becomes switched to grayed (indeterminate state).|
If the State parameter corresponds to the item’s current state (for example, State is
cbChecked and the item is already checked),
CheckItem performs no action. To toggle the item’s state without moving the mouse pointer, use
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.
wItemState Property (Specific to CheckedListBox and CheckListBox Controls)
wItem Property (ListBox Controls)
wItemCount Property (ListBox Controls)
wSelected Property (ListBox Controls)