A horizontal or vertical slider for choosing magnitude.

Syntax

[<oRef> =] new Slider(<container> [,<name expC>])

<oRef>

A variable or property—typically of <container>—in which to store a reference to the newly created Slider object.

<container>

The container—typically a Form object—to which you’re binding the Slider object.

<name expC>

An optional name for the Slider object. If not specified, the Slider class will auto-generate a name for the object.

Properties

The following tables list the properties, events, and methods of interest in the Slider class.

Property

Default

Description

baseClassName

SLIDER

Identifies the object as an instance of the Slider class

className

(SLIDER)

Identifies the object as an instance of a custom class. When no custom class exists, defaults to baseClassName

colorNormal

BtnFace

The color of the slider

enableSelection

false

Whether to display the selection range

endSelection

 

The value of the end of the selection range

rangeMax

 

The maximum value

rangeMin

 

The minimum value

startSelection

 

The value of the start of the selection range

tics

Auto

How to display the tic marks (0=Auto, 1=Manual, 2=None)

ticsPos

Bottom Right

Where to display the tic marks (0=Both, 1=Bottom Right, 2=Top Left)

value

 

The current value

vertical

false

Whether the slider is vertical or horizontal

 

Event

Parameters

Description

onChange

 

After the slider position changes

 

Method

Parameters

Description

clearTics( )

<expN>

If <expN> is non-zero, clears all manually-set tic marks

setTic( )

<expN>

Manually sets a tic mark at the specified position

setTicFrequency( )

<expN>

Sets the automatic tic mark interval

 

The following table lists the common properties, events, and methods of the Slider class:

Property

 

Event

 

Method

before
borderStyle

dragEffect

enabled

form

height

helpFile

helpId

hWnd

id

left

mousePointer

name
pageno

parent

printable

speedTip

statusMessage

systemTheme

tabStop

top

visible

width

beforeRelease
onClose

onDesignOpen

onDragBegin

onGotFocus

onHelp

onLeftMouseDown

onLeftMouseUp

onLostFocus

onMiddleMouseDown
onMiddleMouseUp

onMouseMove

onOpen

onRightMouseDown

onRightMouseUp

when

drag( )
move( )

release( )

setFocus( )

Description

Use a slider to let users vary numeric values visually. Unlike spinboxes, sliders don't accept keyboard input or use a step value. Instead, the user drags the slider pointer to increase or decrease the value.

As the user moves the slider pointer, the value is continually updated to reflect the position of the pointer. For example, a slider that varies a numeric value between 1 and 100 sets the value to 50 when the slider pointer is at the center of the slider.

To set a range for the slider, set rangeMin to the minimum value and rangeMax to the maximum value.

You may also designate a separate selection region inside the slider with the startSelection, endSelection, and enableSelection properties.

You have complete control over the tick marks that appear in the slider.