---
title: "createTab"
canonical: "https://help.vicon.com/space/Shogun16/13339800/createTab"
format: markdown
---
# Description

Creates a tab user control on the user window specified by `parentWindowID`. A tab is a way to organize user controls.

To have a tab manage controls, use the [createForm](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13340092) command to create a form for every tab. Then control all the associated forms' visibility based on the active tab (using [getTabSelItem](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13341506)), and the controls for that tab will follow.

## Functional area

User Window

# Command syntax

## Syntax

|  |
| --- |
| `createTab  parentWindowID [-hidden] [-pos integer array] [-form integer]` |

### Arguments

| **Name** | **Type** | **Required** | **Comments** |
| --- | --- | --- | --- |
| `parentWindowID` | int | yes | ID of user window to place the control on. |

### Flags

> Macro (scroll-tablelayout)

| **Name** | **Flag arguments** | **Argument type** | **Exclusive to** | **Comments** |
| --- | --- | --- | --- | --- |
| `hidden` | 0 | — | — | The tab is hidden until changed by a user event. |
| `pos` | 1 | integer array | — | A four-element int array representing a rectangle, which specifies the initial size/position of the form relative to the top left corner of the user window. The element order is Left, Top, Right, and Bottom. Default is a form 200 units high by 200 units wide. |
| `form` | 1 | integer | — | Control ID of the form user control which will dynamically position this form. |

## Return value

integer

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

- [addTab](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13340717)
- [deleteAllTabItems](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13339836)
- [deleteTabItem](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13339887)
- [findTabItem](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13339779)
- [getTabItem](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13341476)
- [getTabSelItem](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13341506)
- [selectTabItem](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13340386)
- [setTabHandler](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13341818)