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

Sets 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"), either a Boolean or an integer is accepted for checkVal.

## Functional area

User Window

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `setCheckBoxCheck userControlID check` |

### Arguments

> Macro (scroll-tablelayout)

| Name | Type | Required | Comments |
| --- | --- | --- | --- |
| `checkVal` | int | yes | 0 to uncheck the control, 1 to check it, or 2 to set it to indeterminate |
| `userControlId` | int | yes | ID of User Control to operate on. |

### Flags

None

## Return value

void

> Macro (scroll-pagebreak)

## Examples

```plaintext
// Set 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`;
 
// Set the value to "indeterminate"
setCheckBoxCheck $controlId 2;
 
// 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)
- [getCheckBoxCheck](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738268)
- [setCheckBoxHandler](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736486)