Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Visual C++ and MFC Fundamentals Chapter 17: Track-Based Controls


the slider with ticks. If you do not want to display the ticks at all, at design time, clear the
Tick Marks property or set its value to False.

The ticks are positioned on the side the thumb is pointing. If the slider is created with the
Both value for the Point property or the TBS_BOTH style, the ticks would appear on
both sides the thumb.

The thumb of a slider is used to scroll from one minimum value to another. The range of
these extreme values can be divided in regular increments that can further guide the user
with value selection. To display where these increments are set, at design time, set the
Auto Ticks property to True or add the TBS_AUTOTICKS style:

Practical Learning: Designing a Track Bar



  1. While the slider control is selected on the dialog box, on the Properties window,
    change its ID to IDC_SLIDER

  2. Check its Auto Ticks check box or set it to True

  3. Check its Tick Marks check box or set it to True

  4. Set its Point property to Top/Left

  5. Set to True the Tooltips property of the slider control

  6. Add a Control variable for the slider and name it m_CarSlider

  7. Test the application and return to MSVC

Free download pdf