Admin Production ni-theme
Current Publication

SetActiveTreeItem

LabWindows/CVI

SetActiveTreeItem

int SetActiveTreeItem (int panelHandle, int controlID, int itemIndex, int selectionEffect);

Purpose

Sets the active item of a tree control. If the tree is in multiple selection mode, the effect on the selection is determined by the selectionEffect parameter.

Supported Controls

You can use SetActiveTreeItem with tree controls.

Parameters

Input
Name Type Description
panelHandle int Specifier for a particular panel that is currently in memory. You can obtain this handle from functions such as LoadPanel and NewPanel.
controlID int 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 functions such as NewCtrl and DuplicateCtrl.
itemIndex int Zero-based index of the tree item.
selectionEffect int Defines the effect on the selection state of the tree items.

Note    This parameter is ignored if the tree is not in multiple selection mode.

VAL_NO_SELECTION_EFFECT—no selection change.
VAL_TOGGLE_SELECTION_OF_ITEM—toggle the selection of the new active item.
VAL_ADD_ITEM_TO_SELECTION—select the new active item.
VAL_ADD_INTERVAL_TO_SELECTION—select all items between the old active item and the new active item.
VAL_REPLACE_SELECTION_WITH_ITEM—deselect all items and leave only the new active item selected.

Return Value

Name Type Description
status int Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 7.0 and later