Sliders 

A slider, sometimes called a trackbar, is a control for selecting one of a range of values. It consists of a bar that represents the range and an indicator that shows the current value. Sliders are especially useful when all of the values in a range aren't known in advance. Sliders represent defined, contiguous values (such as volume or brightness) or a range of discrete values (such as screen resolution settings). Sliders are best used for ranges of four or more values; for smaller ranges, consider using option buttons instead.

Art Image

Sliders support a number of options. You can define the length and height of the slide indicator and the slide bar component, define the increments of the slider, and display tick marks for the control.

Developer Note:
Tick Marks The following table describes messages you can send to control the ticks on a slider control.

If you want to provide continuous selection along the range without the slider “snapping” to the tick marks, set the range to be large (for example, 100), the frequency to be smaller (for example, 10), and the pagesize small (for example, 1).

Message Purpose

TBM_SETTIC

Sets tick marks at any position

TBM_SETRANGE

Specifies the number of tick marks

TBM_SETTICFREQ

Specifies how many tick marks are displayed for each increment in the trackbar’s range. The default is 1.

TBM_SETPAGESIZE

Specifies the number of logical positions the trackbar’s slider moves in response to keyboard input. The default is 4.

See Also

Concepts

List Boxes
Option Buttons