wButtonBounds Property (ToolBar and MenuBar Controls)

Applies to TestComplete 15.45, last modified on December 01, 2022

Description

Use this property to get information about the bounds of the control’s item. The item can be of any kind: a button, a checkbox, a drop-down button, a separator and so on.

Declaration

TestObj.wButtonBounds(Item, By Position)

Read-Only Property A Bounds object
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    
By Position [in]    Optional    Boolean Default value: False   

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 parameters:

Item

Specifies the caption, identifier or position (from 0) of the desired item on the control. For more information, see the Remarks section.

By Position

Specifies whether the Item parameter specifies the identifier or position of the item. For more information, see the Remarks section. If Item holds a string, the ByPosition parameter is ignored.

Property Value

A Bounds object that contains the information about the item’s bounding rectangle.

Remarks

You can specify the desired control’s item by assigning item’s caption, identifier or position on the control to the Item parameter. Therefore, if this parameter holds a string, TestComplete identifies the item by caption. When Item specifies the caption, you can use wildcards (* and ?) or regular expressions to mark variable parts of the caption. The caption can be case-sensitive or case-insensitive depending on the value of the Use case-sensitive parameters project setting. If Item holds an integer value, then TestComplete checks the ByPosition parameter to determine in what way to identify the item: if ByPosition is True, TestComplete treats the Item value as the item position; if ByPosition is False, TestComplete treats the Item value as an identifier.

If you use Python or DelphiScript, you should enclose the parameter of the wButtonBounds property in square brackets: wButtonBounds[Item, ByPosition].

Example

To view an example that demonstrates how to use the wButtonBounds property, see Selecting Items From Drop-Down Menus in Desktop Windows Applications.

See Also

Bounds Object

Highlight search results