---
title: "deleteDropListItem"
canonical: "https://help.vicon.com/space/ShogunPost121/1253736653/deleteDropListItem"
format: markdown
---
# 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

> Macro (scroll-tablelayout)

|  |
| --- |
| `deleteDropListItem userControlID itemIndex or "itemString"` |

### Arguments

> Macro (scroll-tablelayout)

| 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. |

### Flags

None

## Return value

integer

> Macro (scroll-pagebreak)

## Examples

```plaintext
// 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

- [addDropListItem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736554)
- [createDropList](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736918)
- [deleteAllDropListItems](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737405)
- [findDropListItem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736586)
- [getDropListItem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737152)
- [getDropListSelItem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736825)
- [getNumDropListItems](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253739071)
- [selectDropListItem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737783)
- [setDropListHandler](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738701)