CSliderCtrl Class

Provides the functionality of the Windows common slider control.

class CSliderCtrl : public CWnd

Members

Public Constructors

Name

Description

CSliderCtrl::CSliderCtrl

Constructs a CSliderCtrl object.

Public Methods

Name

Description

CSliderCtrl::ClearSel

Clears the current selection in a slider control.

CSliderCtrl::ClearTics

Removes the current tick marks from a slider control.

CSliderCtrl::Create

Creates a slider control and attaches it to a CSliderCtrl object.

CSliderCtrl::CreateEx

Creates a slider control with the specified Windows extended styles and attaches it to a CSliderCtrl object.

CSliderCtrl::GetBuddy

Retrieves the handle to a slider control buddy window at a given location.

CSliderCtrl::GetChannelRect

Retrieves the size of the slider control's channel.

CSliderCtrl::GetLineSize

Retrieves the line size of a slider control.

CSliderCtrl::GetNumTics

Retrieves the number of tick marks in a slider control.

CSliderCtrl::GetPageSize

Retrieves the page size of a slider control.

CSliderCtrl::GetPos

Retrieves the current position of the slider.

CSliderCtrl::GetRange

Retrieves the minimum and maximum positions for a slider.

CSliderCtrl::GetRangeMax

Retrieves the maximum position for a slider.

CSliderCtrl::GetRangeMin

Retrieves the minimum position for a slider.

CSliderCtrl::GetSelection

Retrieves the range of the current selection.

CSliderCtrl::GetThumbLength

Retrieves the length of the slider in the current trackbar control.

CSliderCtrl::GetThumbRect

Retrieves the size of the slider control's thumb.

CSliderCtrl::GetTic

Retrieves the position of the specified tick mark.

CSliderCtrl::GetTicArray

Retrieves the array of tick mark positions for a slider control.

CSliderCtrl::GetTicPos

Retrieves the position of the specified tick mark, in client coordinates.

CSliderCtrl::GetToolTips

Retrieves the handle to the tooltip control assigned to the slider control, if any.

CSliderCtrl::SetBuddy

Assigns a window as the buddy window for a slider control.

CSliderCtrl::SetLineSize

Sets the line size of a slider control.

CSliderCtrl::SetPageSize

Sets the page size of a slider control.

CSliderCtrl::SetPos

Sets the current position of the slider.

CSliderCtrl::SetRange

Sets the minimum and maximum positions for a slider.

CSliderCtrl::SetRangeMax

Sets the maximum position for a slider.

CSliderCtrl::SetRangeMin

Sets the minimum position for a slider.

CSliderCtrl::SetSelection

Sets the range of the current selection.

CSliderCtrl::SetThumbLength

Sets the length of the slider in the current trackbar control.

CSliderCtrl::SetTic

Sets the position of the specified tick mark.

CSliderCtrl::SetTicFreq

Sets the frequency of tick marks per slider control increment.

CSliderCtrl::SetTipSide

Positions a tooltip control used by a trackbar control.

CSliderCtrl::SetToolTips

Assigns a tooltip control to a slider control.

Remarks

A "slider control" (also known as a trackbar) is a window containing a slider and optional tick marks. When the user moves the slider, using either the mouse or the direction keys, the control sends notification messages to indicate the change.

Slider controls are useful when you want the user to select a discrete value or a set of consecutive values in a range. For example, you might use a slider control to allow the user to set the repeat rate of the keyboard by moving the slider to a given tick mark.

This control (and therefore the CSliderCtrl class) is available only to programs running under Windows 95/98 and Windows NT version 3.51 and later.

The slider moves in increments that you specify when you create it. For example, if you specify that the slider should have a range of five, the slider can only occupy six positions: a position at the left side of the slider control and one position for each increment in the range. Typically, each of these positions is identified by a tick mark.

You create a slider by using the constructor and the Create member function of CSliderCtrl. Once you have created a slider control, you can use member functions in CSliderCtrl to change many of its properties. Changes that you can make include setting the minimum and maximum positions for the slider, drawing tick marks, setting a selection range, and repositioning the slider.

For more information on using CSliderCtrl, see Controls and Using CSliderCtrl.

Inheritance Hierarchy

CObject

CCmdTarget

CWnd

CSliderCtrl

Requirements

Header: afxcmn.h

See Also

Reference

CWnd Class

Hierarchy Chart

CProgressCtrl Class

Concepts

MFC Sample CMNCTRL2