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

Gets the check value of the check box user control that is specified by `userControlID`.

Because check boxes can be created with the `-triState` flag (the third state being "indeterminate") a Boolean is not sufficient to accommodate all possible check values. Thus, the command returns an integer: 0 for not checked, 1 for checked, and 2 for "indeterminate".

## Functional area

User Window

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `getCheckBoxCheck userControlID` |

### Arguments

| Name | Type | Required | Comments |
| --- | --- | --- | --- |
| `userControlId` | int | yes | ID of user control to operate on. |

### Flags

None

## Return value

integer 

> Macro (scroll-pagebreak)

## Examples

```plaintext
// Get the checked value of a Check Box User Control
int $windowId;
int $controlId;
int $checked;
 
// First create a User Window to place the Control on
$windowId = `createWindow "MyWindow"`;
 
// Create the User Control on the Window. 
$controlId = `createCheckBox $windowId -triState`;
 
// Get the value on the Check Box. 
$checked = `getCheckBoxCheck $controlId`;
if( $checked == 1 )
   {
print "Checked";
   }
else if( $checked == 0 )
   { 
print "Unchecked";
   }
else
   { 
print "Indeterminate";
   }
```

# Additional information

## Related commands

- [createCheckBox](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738866)
- [setCheckBoxCheck](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737181)
- [setCheckBoxHandler](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736486)