---
title: "setNumBoxRange"
canonical: "https://help.vicon.com/space/Shogun16/13340224/setNumBoxRange"
format: markdown
---
# Description

Set the range of a number box user control on the given user window so that there is a set minimum and maximum value that cannot be exceeded.

## Functional area

User Window

# Command syntax

## Syntax

|  |
| --- |
| `setNumBoxRange userControlID minVal maxVal` |

### Arguments

> Macro (scroll-tablelayout)

| **Name** | **Type** | **Required** | **Comments** |
| --- | --- | --- | --- |
| `maxVal` | float/int | yes | Maximum number that the num box will display |
| `minVal` | float/int | yes | Minimum number that the num box will display |
| `userControlId` | int | yes | ID of user control to apply command to |

### Flags

None

## Return value

void 

> Macro (scroll-pagebreak)

## Examples

```plaintext
// Create a Check Box User Control.
int $windowId;
int $controlId;
float $value = 10.0;
 
// First create a User Window to place the Control on 
$windowId = `createWindow "MyWindow"`;
 
// Create the Control on the Window, passing
// in the Window Id of the User Window we 
// just created. Make floating point, specifying the initial
// value and a spinner
$controlId = `createNumBox $windowId -num $value -spin -flt`;
setNumBoxRange $controlId 10.0 20.0;
```

# Additional information

## Related commands

- [createNumBox](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13339953)
- [getNumBoxNum](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13340774)