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

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

A check box gives the user a yes/no or true/false option. 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

|  |
| --- |
| `createCheckBox parentWindowID [-hidden] [-text string] [-pos integer array] [-form integer] [-triState] [-left] [-check]` |

### 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** |
| --- | --- | --- | --- | --- |
| `triState` | 0 | — | — | Specifies that the check box have an"indeterminate" state, in addition to "checked" and"unchecked". |
| `left` | 0 | — | — | Specifies that the button text appear on the left side of the check box. The default is text on the right. |
| `check` | 0 | — | — | Specifies that the check box is initially"checked". The default is "unchecked". |
| `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. |
| `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 check 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 

> Macro (scroll-pagebreak)

## Examples

```plaintext
// Create a Check 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. Make the Check Box tri-state and set its text
$controlId = `createCheckBox $windowId -triState -text "Check Me!" -pos $rect`;
```

# Additional information

## Related commands

- [getCheckBoxCheck](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13075411)
- [setCheckBoxCheck](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13075927)