---
title: "createTextBox"
canonical: "https://help.vicon.com/space/Shogun19/13795904/createTextBox"
format: markdown
---
# Description

Creates a static box user control on the user window that is specified by `windowID`.

A static box is simply some text, used to label other controls, or provide feedback.

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/Shogun19/pages/13796570) 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

|  |
| --- |
| `createTextBox parentWindowID[-hidden] [-text string] [-pos integer array] [-form integer] [-right] [-center] [-multiLine] [-password] [-readOnly]` |

### Arguments

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

> Macro (scroll-pagebreak)

### Flags

> Macro (scroll-tablelayout)

| **Name** | **Flag arguments** | **Argument type** | **Exclusive to** | **Comments** |
| --- | --- | --- | --- | --- |
| `right` | 0 | — | — | Specifies that the text be right justified in the control. The default is left justified. |
| `center` | 0 | — | — | Specifies that the text be centered in the control. The default is left justified. |
| `multiLine` | 0 | — | — | Specifies that text be allowed to span more than one line. This does not cause text to automatically wrap. Rather, hitting Ctrl+Enter will start a new line. Default is single line. |
| `password` | 0 | — | — | Specifies that the text box show *s in place of the text. Good for passwords. |
| `readOnly` | 0 | — | — | Specifies that the text be uneditable. No modification to the text can be made by the user. |
| `hidden` | 0 | — | — | Specifies that the control should be hidden initially. Call [showControl](https://vicon-help.atlassian.net/wiki/spaces/Shogun19/pages/13796688) to subsequently make it visible. The default is for it to be visible. |
| `text` | 1 | string | — | The text that gets displayed with the control. The default is no text. |
| `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 text 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 Text Box user control.
int $windowId;
int $controlId; 
int $rect[4];

// 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 
  
// Create the control on the window, passing
// in the Window Id of the user window we just created.
$controlId = `createTextBox $windowId-text "This is some text!" -pos $rect`;
```

# Additional information

## Related commands

- [getControlText](https://vicon-help.atlassian.net/wiki/spaces/Shogun19/pages/13796068)
- [setControlText](https://vicon-help.atlassian.net/wiki/spaces/Shogun19/pages/13796572)