---
title: "addTab"
canonical: "https://help.vicon.com/space/ShogunPost121/1253738413/addTab"
format: markdown
---
# Description

Adds an additional tab to the already created tab controller

## Functional area

User Window

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `addTab userControlID "itemString"` |

### Arguments

| Name | Type | Required | Comments |
| --- | --- | --- | --- |
| `itemString` | string | no | The name of the tab to be added |
| `userControlId` | int | yes | ID of user window to place the control on. |

### Flags

None

## Return value

integer 

> Macro (scroll-pagebreak)

## Examples

```plaintext
// Create a Tab control and add two tabs 
int $windowId;
int $tabControl;
int $firstTab;
int $secondTab;
 
// First create a User Window to place the Control on
$windowId = `createWindow "MyWindow"`;
 
//create a tab control
$tabControl = `createTab $windowId`;
 
//add tabs$firstTab = `addTab $tabControl "First"`;
$secondTab = `addTab $tabControl "Second"`;
```

# Additional information

## Related commands

- [createTab](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736857)
- [deleteAllTabItems](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737096)
- [deleteTabItem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737436)
- [findTabItem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738418)
- [getTabItem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738257)
- [getTabSelItem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736870)
- [selectTabItem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737385)
- [setTabHandler](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253739964)