/
deleteDropListItem

deleteDropListItem

Description

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

To delete an item, either provide the index of the item to delete, or a string of the item to delete (but not both). The string must exactly match for it to be deleted.

Functional area

User Window

Command syntax

Syntax

deleteDropListItem userControlID itemIndex or "itemString"

Arguments

NameTypeRequiredComments
itemStringintyesMatching string of the item to delete. Either an index should be provided, or a string, but not both.
indexintyesZero based index of the item to delete. Either an index should be provided, or a string, but not both.
userControlIdintyesID of user control to operate on.

Flags

None

Return value

integer

Examples

// Delete an item in a Drop List User Control.
int $windowId;
int $controlId;
// 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";
addDropListItem $controlId "Item 2";
addDropListItem $controlId "Item 3";
addDropListItem $controlId "Item 4";
 
// Delete the second and third items.
deleteDropListItem $controlId 1;
deleteDropListItem $controlId "Item 3";

Additional information

Related commands