---
title: "createTimeBox"
canonical: "https://help.vicon.com/space/Shogun110/13075275/createTimeBox"
format: markdown
---
# Description

Creates a time box user control on the user window specified by `windowID`. A time box is a text box which specifically deals with frame numbers, respecting the time appearance in Shogun.

The control is initially placed in the top-left corner of the user window, and must be placed by using the `-pos` option, or by using the [setControlPos](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13075939) command.

The command returns the control ID of the user control, which should be saved for later operations on the control.

## Functional area

User Window

# Command syntax

## Syntax

|  |
| --- |
| `createTimeBox parentWindowID[-hidden] [-pos integer array] [-form integer] [-frame integer]` |

### Arguments

| **Name** | **Type** | **Required** | **Comments** |
| --- | --- | --- | --- |
| `windowId` | 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 | — | — | Specifies that the control should be hidden initially. Call [showControl](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13076057) to subsequently make it visible. The default is for it to be visible. |
| `frame` | 1 | integer | — | Specifies that the frame number to display. |
| `pos` | 1 | integer array | — | A four-element int array representing a rectangle, which specifies the initial size/position of the control relative to the top left corner of the user window. The element order is Left, Top, Right, and Bottom. The default is a time box 20 units high by 50 units wide. |
| `form` | 1 | integer | — | Control ID of the form user control which will dynamically position this control. |

## Return value

integer

## Examples

```plaintext
// Create a time box user control.
int $windowId;
int $controlId; 
int $rect[4];
int $playEnd;
 
// First create a user window to place the Control on
$windowId = `createWindow "MyWindow"`;
 
// Specify the size of the Control - 100 units wide
$rect[0] = 20;  // Left
$rect[1] = 20;  // Top
$rect[2] = 120; // Right
$rect[3] = 40;  // Bottom
 
// Get the end of the play range
$playEnd = `getPlayEnd`;
 
// Create the Control on the Window, passing
// in the Window Id of the user window we 
// just created. Set the frame number to be
// the end of the play range.
$controlId = `createTimeBox $windowId-pos $rect -frame $playEnd`;
```

> Macro (scroll-pagebreak)

# Additional information

## Related commands

- [getControlText](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13075437)
- [setControlText](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13075941)