# AreTreeItemsRelated

int AreTreeItemsRelated (int panelHandle, int controlID, int itemIndex, int relation, int relativeIndex, int *areRelated);

## Purpose

Returns a Boolean value indicating whether two tree items are related in a specified manner.

Returns true if the item at Item Index meets the Relation requirement with respect to the item at Relative Index.

## Parameters

Input
Name | Type | Description
panelHandle | integer | Specifier for a particular panel that is currently in memory. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel.
controlID | integer | The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by NewCtrl or DuplicateCtrl.
itemIndex | integer | Zero-based index of a tree item.
relation | integer | Defines the relationship to be tested between the two tree items. You can select the following values. VAL_ALL—Specify whether the tree items have any relationship. VAL_SIBLING—Specify whether the tree items are siblings. VAL_CHILD—Specify whether itemIndex is a child of relativeIndex. VAL_DESCENDENT—Specify whether itemIndex is a descendent of relativeIndex. VAL_ANCESTOR—Specify whether itemIndex is an ancestor of relativeIndex.
relativeIndex | integer | Zero-based index of a tree item.
Output
Name | Type | Description
areRelated | integer | A Boolean value indicating whether the items are related to each other with the specified relationship. 0 = not related 1 = related

## Return Value

Name | Type | Description
status | integer | Return value indicating whether the function was successful. A negative number indicates that an error occurred.
Code | Error Message String
xx | Success