Description
Depending on the Expand parameter, the Expand
action expands or collapses the specified grid item. The effect is the same as when you click the item’s “+” (or “-”) button. You can also expand grid items by double-clicking on them (see DblClickLabel
). Unlike DblClickLabel
, the Expand
action does not move the mouse cursor.
Declaration
TestObj.Expand(Item, Expand)
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 | |
Expand | [in] | Optional | Boolean | Default value: True |
Result | None |
Applies To
The method is applied to the following objects:
Developer Express PropertyGridControl, MFC PropertyGrid, Microsoft PropertyGrid, PropertyGridControlItem
View Mode
This method is available in the Object Browser panel and in other panels and dialogs in both Basic and Advanced view modes.
Parameters
The method has the following parameters:
Item
Specifies the index or caption of the desired item whose label needs to be clicked.
The index is zero-based, that is, the index of the first item is 0. The index of the last item is wItemCount - 1
.
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.
Expand
Specifies whether to expand or collapse the specified grid item.
Result Value
None.
Remarks
If the specified item is not found, Expand
fails and posts an error message to the test log.
To expand an item, you can also call the Expand
action with the Expand parameter set to False, or use the DblClickLabel
action.
The script recorder recognizes mouse clicks on the “+” buttons within the items' labels and records the Expand
command.
Example
To view an example that demonstrates how to use the Expand
action, see Expanding and Collapsing Items in Microsoft PropertyGrid.
See Also
Collapse Action (Specific to PropertyGrid Controls)
wExpanded Property (Specific to PropertyGrid Controls)