---
title: "DiscreteKnob (Basic)"
canonical: "https://docs.cuesystem.com/space/CVCGC/407175189/DiscreteKnob%20(Basic)"
format: markdown
---
> Macro (toc)

---

# Description

This object is rotary selector from one up to eight predefined cases. It is typically used for input selection. Number of positions can be set by property and every position is labeled by user text. Active position is indicated by LED.

![image](media://8dc21374-cbcc-4adc-9455-9eab5603c3c9)

# Properties

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| Property Name | Data Type | Allowed Values | Default Value | Description |
| Behavior |
| DefaultCase | Byte | 1 to 8 | 1 | Initial value of knob case after reset |
| Appearance |
| ActiveColor | Long | 1 = Blue  
2 = Green  
3 = Yellow  
4 = Orange  
5 = Purple | 1 | Color of active state |
| LabelCase1 | AddressOf Text | Any | Nothing | Text shown for Case1 |
| ... | ... | ... | ... | ... |
| LabelCase8 | AddressOf Text | Any | Nothing | Text shown for Case8 |
| LabelFont | AddressOf _Font | Any | fntDefault16 | Text font used for all LabelCases.  fntDefault16 is Verdana 16 pixels high. |
| ObjectSize | Long | 0 = Drag&Fit  
1 = 120x100  
2 = 150x125  
3 = 180x150  
4 = 240x200  
5 = 300x250  
6 = 420x350  
7 = 540x450  
8 = 720x600 | 0 | Specifies size of the object. If Drag&Fit is selected it picks biggest size which fits into object boundary. |

# Functions

## SetActiveCase

This function sets active case to newactivecase value if newactivecase >= 1 and newactivecase <= 8. Then function returns True, else it returns False.

#### Syntax

```visualbasic
Function SetActiveCase(newactivecase As Byte) As Boolean
```

## GetActiveCase

This function returns current active case.

#### Syntax

```visualbasic
Function GetActiveCase() As Byte
```

## SetActiveColor

This function sets ActiveColor of case indicator to newactivecolor. Possible values are

- 1 = Blue
- 2 = Green
- 3 = Yellow
- 4 = Orange
- 5 = Purple

The function returns True on success or False if an error occurs (parameter is out of limits).

#### Syntax

```visualbasic
Function SetActiveColor(newactivecolor As Long) As Boolean
```

## GetActiveColor

This function returns current ActiveColor of case indicator. For possible values see command SetActiveColor.

#### Syntax

```visualbasic
Function GetActiveColor() As Long
```

## SetLabelCase1

This function sets LabelCase1 text to newlabelcase1. As newlabelcase1 you can use direct value of text. In this case you will lose the possibility of changing the language of this caption. You can also use addressof text as parameter (text must be declared in MyCommon/Text resources). In this case it is possible to change the language of the caption.

Function returns True.

#### Syntax

```visualbasic
Function SetLabelCase1(newlabelcase1 As Text) As Boolean
```

## GetLabelCase1 

This function returns addressof the current LabelCase1 text.

#### Syntax

```visualbasic
Function GetLabelCase1() As AddressOf Text
```

## SetLabelCase8

This function sets LabelCase8 text to newlabelcase8. As newlabelcase1 you can use direct value of text. In this case you will lose the possibility of changing the language of this caption. You can also use addressof text as parameter (text must be declared in MyCommon/Text resources). In this case it is possible to change the language of the caption.

Function returns True.

#### Syntax

```visualbasic
Function SetLabelCase8(newlabelcase8 As Text) As Boolean
```

## GetLabelCase8

This function returns addressof the current LabelCase8 text.

#### Syntax

```visualbasic
Function GetLabelCase8() As AddressOf Text
```

## SetLabelFont

This function sets the font of all LabelCase texts to newlabelfont. Function returns True.

#### Syntax

```visualbasic
Function SetLabelFont(newlabelfont As AddressOf _Font) As Boolean
```

## GetLabelFont

This function returns address of font used for LabelCase texts.

#### Syntax

```visualbasic
Function GetLabelFont() As AddressOf _Font
```

## SetObjectSize

This function sets object size to newobjectsize. Possible values are

- 0 = Drag&Fit
- 1 = 120x100
- 2 = 150x125
- 3 = 180x150
- 4 = 240x200
- 5 = 300x250
- 6 = 420x350
- 7 = 540x450
- 8 = 720x600

The function returns True on success or False if an error occurs.

#### Syntax

```visualbasic
Function SetObjectSize(newobjectsize As Long) As Boolean
```

## GetObjectSize

This function returns current object size. For possible values see function SetObjectSize.

#### Syntax

```visualbasic
Function GetObjectSize() As Long
```

# Events

## OnCaseChange

This event is generated when the knob case changes. New knob case is delivered in parameter newvalue. Possible values are 1 to 8.

#### Syntax

```visualbasic
Event OnCaseChange As Process(newcase As Byte)
```