Vicon Shogun banner

Description

Selects an item in the drop list user control that is specified by userControlID.

The selected item is the item that is displayed when the drop list is collapsed. When it is dropped, the selected item is highlighted. If no item is selected, no text is displayed when the drop list is collapsed, and no items are highlighted when dropped.

To remove selection, pass a -1 as the index argument.

Functional area

User Window

Command syntax

Syntax

selectDropListItem userControlID indexOrString

Arguments

NameTypeRequiredComments
indexintyesZero based index of the item to select.
userControlIdintyesID of user control to operate on.

Flags

None

Return value

boolean

Examples

// Select an item in a Drop List User Control.
int $windowId;
int $controlId;
int $index;

// First create a User Window to place the Control on
$windowId = `createWindow "MyWindow"`;

// Create the User Control on the Window.
$controlId = `createDropList $windowId`;

// Add some items to the Drop List.
addDropListItem $controlId "Item 1";
$index = `addDropListItem $controlId "Item 2"`;
addDropListItem $controlId "Item 3";

// Select the item whose index we just got.
selectDropListItem $controlId $index;

Additional information

Related commands