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

---

# Description

This object simulates classic rotary potentiometer and it serves for proportional setting the value between Minimum and Maximum. AnalogKnob allows to set and display an analog value like volume, temperature, light level etc. Labels for minimum and maximum positions can be defined. Working angle is 270 degrees with the middle on the top.

![image](media://9853284c-1ebf-4d36-aa33-a3260bf949ae)

# Properties

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| Property Name | Data Type | Allowed Values | Default Value | Description |
| Behavior |
| DefaultValue | Double | Any | (Minimum + Maximum) / 2 | Initial value of knob after reset |
| Appearance |
| LabelFont | AddressOf _Font | Any | fntDefault16 | LabelMaximum and LabelMinimum text font. fntDefault16 is Verdana 16 pixels high. |
| LabelMaximum | AddressOf Text | Any | Nothing | Text shown for Maximum |
| LabelMinimum | AddressOf Text | Any | Nothing | Text shown for Minimum |
| ObjectSize | Long | 0 = Drag&Fit   
1 = 100x100  
2 = 120x120  
3 = 160x160  
4 = 200x200  
5 = 280x280  
6 = 360x360  
7 = 480x480  
8 = 600x600 | 0 | Specifies size of the object. If Drag&Fit is selected it picks biggest size which fits into object boundary. |
| Scale |
| Maximum | Double | <> Minimum | 100 | Value of right end of knob scale |
| Minimum | Double | <> Maximum | 0 | Value of left end of knob scale |

# Functions

## SetLabelFont

This function sets the font of LabelMinimum and LabelMaximum texts. Function returns True.

#### Syntax

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

## GetLabelFont

This function returns address of font used for LabelMinimum and LabelMaximum texts.

#### Syntax

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

## SetLabelMaximum

This function sets current LabelMaximum text to newlabelmaximum. As newlabelmaximum 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 SetLabelMaximum(newlabelmaximum As Text) As Boolean
```

## GetLabelMaximum

This function returns addressof the current LabelMaximum text.

#### Syntax

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

## SetLabelMinimum

This function sets current LabelMinimum text to newlabelminimum. As newlabelminimum 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 SetLabelMinimum(newlabelminimum As Text) As Boolean
```

## GetLabelMinimum

This function returns addressof the current LabelMinimum text.

#### Syntax

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

## SetMaximum

This function sets Maximum to newmaximum value. It returns True if newmaximum <> Minimum, else it returns False.

#### Syntax

```visualbasic
Function SetMaximum(newmaximum As Double) As Boolean
```

## GetMaximum

This function returns current Maximum.

#### Syntax

```visualbasic
Function GetMaximum() As Double
```

## SetMinimum

This function sets Minimum to newminimum value. It returns True if newminimum <> Maximum, else it returns False.

#### Syntax

```visualbasic
Function SetMinimum(newminimum As Double) As Boolean
```

## GetMinimum

This function returns current Minimum.

#### Syntax

```visualbasic
Function GetMinimum() As Double
```

## SetObjectSize

This function sets object size to newobjectsize. Possible values are

- 0 = Drag&Fit
- 1 = 100x100
- 2 = 120x120
- 3 = 160x160
- 4 = 200x200
- 5 = 280x280
- 6 = 360x360
- 7 = 480x480
- 8 = 600x600

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
```

## SetValue

This function sets value of the knob. It returns True, if newvalue is in range Minimum – Maximum, otherwise it returns False and knob value is not changed.

#### Syntax

```visualbasic
Function SetValue(newvalue As Double) As Boolean
```

## GetValue

This function returns current knob value.

#### Syntax

```visualbasic
Function GetValue() As Double
```

# Events

## OnValueChange

This event is generated when the knob value changes. New knob value is delivered in parameter newvalue.

#### Syntax

```visualbasic
Event OnValueChange As Process(newvalue As Double) WithRaiseRemember
```