---
title: "GenericSliders"
canonical: "https://docs.cuesystem.com/space/CVCGC/419463184/GenericSliders"
format: markdown
---
> Macro (toc)

---

# Description

This graphic collection includes [HorizontalSlider](https://cue.atlassian.net/wiki/spaces/CVCGC/pages/420282380) and [VerticalSlider](https://cue.atlassian.net/wiki/spaces/CVCGC/pages/419692582). Both objects simulate classic linear potentiometer. It allows to set and display an analog value like volume, temperature, light level etc... Both sliders have the same properties, functions and events described in this section.

![image](media://d9a41e95-9223-44a6-b5c9-120e15344860)

#### Active touch zone description

![image](media://ef0b1cfc-9a6f-4c66-b609-56ee06e36b0f)


![image](media://81f3e03c-9f39-4541-bd97-26d70276da62)

# Properties

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| Property Name | Data Type | Allowed Values | Default Value | Description |
| Behavior |
| ActiveTouchZoneSize | Long | 1, 2, 5, 10, 15,  
20 | 10 | It means width/height of touch active area. See pictures above. |
| AutoSetValue | Boolean | True False | False | If True the slider flood value follows the touch position. If False the slider flood value has to be set via function SetValue otherwise touch position jumps back to flood value after SnapBackTime. |
| DefaultValue | Double | Any | (Minimum +  
Maximum) / 2 | Initial value of slider flood after reset |
| Events | Boolean | True  
False | True | If True event OnTouch is enabled. If False event OnTouch is disabled. |
| SnapBackTime | Time |  | :1.0 | When AutoSetValue = False knob jumps back to flood value after this time. |
| SnapToFinger | Boolean | True   
False | True | If True whole area of slider is active and knob jumps to touch position. If False only knob area is active to change slider value. |
| Appearance |
| BackgroundColor | Long | Any | _COLOR_GREY | Color of background |
| BackgroundPicture | AddressOf _Picture | Any | Nothing | Picture placed as slider background. |
| BevelWidth | Long |  | 4 | Width of bevel to make 3D effect. |
| FloodColor | Long | Any | Red | Color of flood |
| FloodPicture | AddressOf _Picture | Any | Nothing | Picture placed as flood. |
| HighlightColor | Long | Any | Grey | Color of highlight to make 3D effect. |
| KnobPicture | AddressOf _Picture | Any | Nothing | Picture placed as a knob. |
| ShadowColor | Long | Any | Grey | Color of shadow to make 3D effect. |
| Scale |
| Maximum | Double | > Minimum | 100.0 | Maximum value of slider |
| Minimum | Double | < Maximum | 0.0 | Minimum value of slider |
| StepValue | Double | Any | 0.0 | It is discrete step of value change. |
| Type | Long | Linear Log10 | Linear | When type “log10” is set, slider value changes according to a logarithmic scale. |

# Functions

## SetType

This function sets type of scale. Function returns True if newtype is one of the following values:

- SLIDER_SCALE_TYPE_LINEAR = 1
- SLIDER_SCALE_TYPE_LOG10 = 2

#### Syntax

```visualbasic
Function SetType(newtype as long) as Boolean
```

## GetType

This function returns type of scale.

#### Syntax

```visualbasic
Function GetType() as long
```

## SetActiveTouchZoneSize

This function sets ActiveTouchZoneSize to newactivetouchzonesize. Function returns True if newactivetouchzonesize is one of the following values: 1, 2, 5, 10, 15, 20. Otherwise it returns False.

#### Syntax

```visualbasic
Function SetActiveTouchZoneSize(newactivetouchzonesize As Long) As Boolean
```

## GetActiveTouchZoneSize

This function returns current ActiveTouchZoneSize.

#### Syntax

```visualbasic
Function GetActiveTouchZoneSize() As Long
```

## SetAspectRatioMaximum

This function sets AspectRatioMaximum to newaspectratiomaximum. Function returns True if newaspectratiomaximum >= AspectRatioMinimum, otherwise it returns False.

#### Syntax

```visualbasic
Function SetAspectRatioMaximum(newaspectratiomaximum As Double) As Boolean
```

## GetAspectRatioMaximum

This function returns current AspectRatioMaximum.

#### Syntax

```visualbasic
Function GetAspectRatioMaximum() As Double
```

## SetAspectRatioMinimum

This function sets AspectRatioMinimum to newaspectratiominimum. Function returns True if newaspectratiominimum <= AspectRatioMaximum, otherwise it returns False.

#### Syntax

```visualbasic
Function SetAspectRatioMinimum(newaspectratiominimum As Double) As Boolean
```

## GetAspectRatioMinimum

This function returns current AspectRatioMinimum.

#### Syntax

```visualbasic
Function GetAspectRatioMinimum() As Double
```

## SetAutoSetValue

This function sets AutoSetValue to newautosetvalue. Function returns True.

#### Syntax

```visualbasic
Function SetAutoSetValue(newautosetvalue As Boolean) As Boolean
```

## GetAutoSetValue

This function returns current AutoSetValue.

#### Syntax

```visualbasic
Function GetAutoSetValue() As Boolean
```

## SetBackgroundColor

This function sets BackgroundColor to newbackgroundcolor. Function returns True.

#### Syntax

```visualbasic
Function SetBackgroundColor(newbackgroundcolor As Long) As Boolean
```

## GetBackgroundColor

This function returns current BackgroundColor.

#### Syntax

```visualbasic
Function GetBackgroundColor() As Long
```

## SetBackgroundPicture

This function sets BackgroundPicture to newbackgroundpicture. Function returns True.

#### Syntax

```visualbasic
Function SetBackgroundPicture(newbackgroundpicture As AddressOf _Picture) As Boolean
```

## GetBackgroundPicture

This function returns address of current BackgroundPicture.

#### Syntax

```visualbasic
Function GetBackgroundPicture() As AddressOf _Picture
```

## SetBevelWidth

This function sets BevelWidth to newbevelwidth. Function returns True if newbevelwidth <= Min(ObjectWidth / 2, ObjectHeight / 2), otherwise it returns False.

#### Syntax

```visualbasic
Function SetBevelWidth(newbevelwidth As Long) As Boolean
```

## GetBevelWidth

This function returns current BevelWidth.

#### Syntax

```visualbasic
Function GetBevelWidth() As Long
```

## SetEvents

This function enables (newevents = True) or disables (newevents = False) event OnTouch. Function returns True.

#### Syntax

```visualbasic
Function SetEvents(newevents As Boolean) As Boolean
```

## GetEvents

This function returns True (event OnTouch enabled) or False (event OnTouch disabled).

#### Syntax

```visualbasic
Function GetEvents() As Boolean
```

## SetFloodColor

This function sets FloodColor to newfloodcolor. Function returns True.

#### Syntax

```visualbasic
Function SetFloodColor(newfloodcolor As Long) As Boolean
```

## GetFloodColor

This function returns current FloodColor.

#### Syntax

```visualbasic
Function GetFloodColor() As Long
```

## SetFloodPicture

This function sets FloodPicture to newfloodpicture. Function returns True.

#### Syntax

```visualbasic
Function SetFloodPicture(newfloodpicture As AddressOf _Picture) As Boolean
```

## GetFloodPicture

This function returns address of current FloodPicture.

#### Syntax

```visualbasic
Function GetFloodPicture() As AddressOf _Picture
```

## SetHighlightColor

This function sets HighlightColor to newhighlightcolor. Function returns True.

#### Syntax

```visualbasic
Function SetHighlightColor(newhighlightcolor As Long) As Boolean
```

## GetHighlightColor

This function returns current HighlightColor.

#### Syntax

```visualbasic
Function GetHighlightColor() As Long
```

## SetKnobPicture

This function sets KnobPicture to newknobpicture. Function returns True.

#### Syntax

```visualbasic
Function SetKnobPicture(newknobpicture As AddressOf _Picture) As Boolean
```

## GetKnobPicture

This function returns address of current KnobPicture.

#### Syntax

```visualbasic
Function GetKnobPicture() As AddressOf _Picture
```

## SetMaximum

This function sets Maximum to newmaximum. Function returns True if newmaximum > Minimum, otherwise 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. Function returns True if newminimum < Maximum, otherwise it returns False.

#### Syntax

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

## GetMinimum

This function returns current Minimum.

#### Syntax

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

## SetShadowColor

This function sets ShadowColor to newshadowcolor. Function returns True.

#### Syntax

```visualbasic
Function SetShadowColor(newshadowcolor As Long) As Boolean
```

## GetShadowColor

This function returns current ShadowColor.

#### Syntax

```visualbasic
Function GetShadowColor() As Long
```

## SetSnapBackTime

This function sets SnapBackTime to newsnapbacktime. Function returns True.

#### Syntax

```visualbasic
Function SetSnapBackTime(newsnapbacktime As Time) As Boolean
```

## GetSnapBackTime

This function returns current SnapBackTime.

#### Syntax

```visualbasic
Function GetSnapBackTime() As Time
```

## SetSnapToFinger

This function sets SnapToFinger to newsnaptofinger value. It returns True.

#### Syntax

```visualbasic
Function SetSnapToFinger (newsnaptofinger As Boolean) As Boolean
```

## GetSnapToFinger

This function returns current value of SnapToFinger.

#### Syntax

```visualbasic
Function GetSnapToFinger () As Boolean
```

## SetStepValue

This function sets StepValue to newstepvalue. Function returns True if newstepvalue <= Abs(Maximum - Minimum, otherwise it returns False.

#### Syntax

```visualbasic
Function SetStepValue(newstepvalue As Double) As Boolean
```

## GetStepValue

This function returns current StepVAlue.

#### Syntax

```visualbasic
Function GetStepValue() As Double
```

## SetValue

This function sets value of slider. It returns True, if newvalue is in range Minimum – Maximum, otherwise it returns False and sets flood to full flood or no flood.

#### Syntax

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

## GetValue

This function returns current Value.

#### Syntax

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

## BringToFrontZOrder

This function temporarily brings the object to the very top position.

#### Syntax

```visualbasic
Function BringToFrontZOrder()
```

## RestoreZOrder

This function restores object’s z-order to value defined in design mode.

#### Syntax

```visualbasic
Function RestoreZOrder()
```

# Events

## OnTouch 

This event is generated when the object is touched and property Events is set to True.

#### Syntax

```visualbasic
Event OnTouch As Process()
```

## OnValueChange 

If StepValue = 0 event is generated whenever slider value changes. If StepValue > 0 event is generated only if change is >= StepValue. New slider value is delivered in parameter newvalue. It is advisable to use only one of the OnRelease or OnValueChange events.

#### Syntax

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

## OnRelease

This event is generated when the object is released. New slider value is delivered in parameter newvalue. It is advisable to use only one of the OnRelease or OnValueChange events.

#### Syntax

```visualbasic
Event OnRelease As Process(newvalue As Double)
```