---
title: "getNumDropListItems"
canonical: "https://help.vicon.com/space/ShogunPost116/341118437/getNumDropListItems"
format: markdown
---
# Description

Gets the number of items in the drop list user control that is specified by `userControlID`.

## Functional area

User Window

# Command syntax

## Syntax

|  |
| --- |
| `getNumDropListItems userControlID` |

### Arguments

| **Name** | **Type** | **Required** | **Comments** |
| --- | --- | --- | --- |
| `userControlId` | int | yes | ID of user control to operate on. |

### Flags

None

## Return value

integer 

> Macro (scroll-pagebreak)

## Examples

```plaintext
// Get the number of Drop List User Control items
int $windowId;
int $controlId;
int $numItems;
 
// 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";
 
// Get the number of items
$numItems = `getNumDropListItems $controlId`;
print $numItems;
```

# Additional information

## Related commands

- [addDropListItem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost116/pages/341116973)
- [createDropList](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost116/pages/341117398)
- [deleteAllDropListItems](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost116/pages/341117595)
- [deleteDropListItem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost116/pages/341117631)
- [findDropListItem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost116/pages/341117814)
- [getDropListItem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost116/pages/341118131)
- [getDropListSelItem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost116/pages/341118137)
- [selectDropListItem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost116/pages/341119608)
- [setDropListHandler](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost116/pages/341119862)