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.
User Window
deleteDropListItem userControlID itemIndex or "itemString" |
Name | Type | Required | Comments |
---|---|---|---|
itemString | int | yes | Matching string of the item to delete. Either an index should be provided, or a string, but not both. |
index | int | yes | Zero based index of the item to delete. Either an index should be provided, or a string, but not both. |
userControlId | int | yes | ID of user control to operate on. |
None
integer
// 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"; |