Creates a list box user control on the user window that is specified by
A list box enables the user to select from a set of list of items.
The control is initially placed in the top-left corner of the user window, and must be placed by using the
-pos option, or by using the setControlPos command.
The command returns the Control ID of the user control, which should be saved for later operations on the control.
|string||no||One or more strings are allowed to populate the list box.|
|int||yes||ID of user window to place the control on.|
|Name||Flag arguments||Argument type||Exclusive to||Comments|
|0||—||—||Specifies that the control should allow multiple selections. The default is single selection only.|
|0||—||—||Forces the control to automatically sort the items in the list box. The default is unsorted|
|0||—||—||Specifies that the control should be hidden initially. Call showControl to subsequently make it visible. The default is for it to be visible.|
|1||integer||—||A zero based index of the item to be selected. The default is no selection.|
|1||integer array||—||A four-element int array representing a rectangle, which specifies the initial size/position of the control relative to the top left corner of the user window. The element order is Left, Top, Right, and Bottom. The default is a drop list 150 units high by 50 units wide.|
|1||integer||—||Control ID of the form user control which will dynamically position this control.|
// Create a list box user control.
// First create a user window to place the Control on
$windowId = `createWindow "MyWindow"`;
// Specify the size of the Control - 80 units high
$rect = 20; // Left
$rect = 20; // Top
$rect = 70; // Right
$rect = 100; // Bottom
// Create the Control on the Window, passing
// in the Window Id of the user window we
// just created. Make the list sorted, add some items,
// and set the initial selection. Also allow for multiple
$controlId = `createListBox $windowId "Item #3" "Item #1" "Item #2" -sort -sel 1 -multi -pos $rect`;